You could try first with reomiving the acc.quit. If Access closes when the EXE closes, then try this instead.
Make a module and add the following code. Then change the bit where it says \"YourDatabase.mdb\" to the name of the database you want to open. Then change \"C:\\temp\" to the directory of where the database is. Then make a call to OpendB
Public Declare Function ShellExecute Lib \"shell32.dll\" Alias \"ShellExecuteA\" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_HIDE = 0 Public Const SW_SHOW = 5
Function OpenDb() as integer Dim result As Integer
result = ShellExecute(0, \"Open\", \"YourDatabase.mdb\", \"\", \"C:\\temp\", SW_SHOW)
The problem is that the acc object is going out of scope. I suggest you try th eother method using ShellExecute. If you were not going to quit the EXE application then you could make the acc object as a global variable. But because you are closing the EXE the acc object is getting \"closed\" too. So as I said try the ShellExecute.
Thanks faroe! No I never did try AccessToVB. I looked at those links but it looked like I needed a key(code) or something. Have you tried it yourself? If you have it then can you send me a copy and I will take a look. But as I also said in the other question, I doubt that it will be able to convert everything. There are so many properties in Access thaht I just CAN NOT believe they can be converted without problem. Bút then I can learn something.
mvh Terry
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.