![]() Set WSHShell = WScript.CreateObject("WScript. & "CurrentVersion\App Paths\MSACCESS.EXE\Path" RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\" _ Here's a VBScript sample which does that, and I'm hoping you can adapt it easily for VB6. You can find the folder where it's located by reading the registry. With the Shell() approach, you would need to supply the full path to MSACCESS.EXE. Use the ADODB database object to create recordsets from data objects and SQL strings in Microsoft Access for the current project (ACCDB, MDB, or ADP) using. Unfortunately, I don't know how to fit that change into the rest of your code, and I've never used VB6.Īlternatively, you could use the Shell Function to start the Access instance, then use GetObject() to set your object variable to that instance. You might revise your VB6 code to keep the variable in scope until you're finished with the Access instance. However, when the variable goes out of scope, the Access instance closes and the form disappears. With your current approach, you use CreateObject to set the object variable appaccess to a new Access application instance, then open your form within that instance. Although you can use it for Access db files, it doesn't provide methods to utilize Access forms. Anyway, i' looking for e method to solve my problem.ĪDO provides methods to interact with various data sources. For Access 2007 (.accdb) and later (.mdb) databases, the only option is to encrypt and protect the database with one password, as the option to have two separate passwords has been removed. So, Although it is not necessary but i prefer to do that with ADO object. If you are using an Access 2003 (.mdb) or earlier database, you will have one password to protect the database, and a separate password to encrypt the database. besides using access object library creates some access version conflicts. DataDirectory functionality Provider .12.0 Data Source DataDirectory\myAccessFile.accdb Persist Security Info False Access 2007 Access 2010 Access 2013 Network Location Provider .12.0 Data Source \\server\share\folder\myAccessFile. Set appaccess = CreateObject("Access.Application")īut when i run this code the form appears and after a while it gets disapear. ![]() Dim appaccess As Access.Application, dbstr As String Note: I have this code that uses Microsoft access 14 object library. I want to open this access form with my application. This form makes the data insertion process faster. Set db = DBEngine.workspaces(0).opendatabase("c:\ss.mdb") I have this code for oppenning: Dim db As DAO.Database I want to add a VB form and open the database in this form to make db edits the DB in that. Quote: >I dont know how to compact a access database(.MDB) with ADO (VB6). My application written with visual basic 6 and it has an Access database. How do you compact database.MDB with ADO and VB6. Access for Microsoft 365 Access 2021 Access 2019 Access 2016 Access 2013 More.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |