Hi all, this is my first post. I am very frustrated with Microsoft Visual Studio 6 - Visual Basic, I am trying to use DAO to talk to a database that was created with Access 2000 and am having no luck. I have the latest service packs for Office and for Visual Basic and Jet and everything like that, but the code still isn't working.
The database file has a system DSN of "lsdata" and I have tried referring to it using both the DSN and the full path.
Basically what I'm trying to do is to open the database using ODBC so that I can change the structure of it using DAO. I was able to get it to work using SQL but I need more control (you can't add autonumber fields using SQL).
Here is the code:
'First I do this
Dim TheDatabaseThingy as Database
'And I have tried both of these
Set TheDataBaseThingy = OpenDatabase("lsdata", dbDriverCompleteRequired, False, "ODBC;UID=;PWD=;DSN=lsdata"
'or
Set TheDataBaseThingy = OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\Connexions Project\Connexions Databases\50.mdb", False, False, "ODBC;DSN=lsdata"
Both "Set" statements return run time error 3423 which has me greatly puzzled. We have tried exporting it as an earlier version of access, and then we got error 3170.
I am tearing my hair out, any help would be appreciated.
The database file has a system DSN of "lsdata" and I have tried referring to it using both the DSN and the full path.
Basically what I'm trying to do is to open the database using ODBC so that I can change the structure of it using DAO. I was able to get it to work using SQL but I need more control (you can't add autonumber fields using SQL).
Here is the code:
'First I do this
Dim TheDatabaseThingy as Database
'And I have tried both of these
Set TheDataBaseThingy = OpenDatabase("lsdata", dbDriverCompleteRequired, False, "ODBC;UID=;PWD=;DSN=lsdata"
'or
Set TheDataBaseThingy = OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\Connexions Project\Connexions Databases\50.mdb", False, False, "ODBC;DSN=lsdata"
Both "Set" statements return run time error 3423 which has me greatly puzzled. We have tried exporting it as an earlier version of access, and then we got error 3170.
I am tearing my hair out, any help would be appreciated.