Air_Cooled_Nut
Registered User.
- Local time
- Today, 13:56
- Joined
- Nov 24, 2004
- Messages
- 17
I have a small VBA module that pulls data from an ODBC data source and appends the data to a local Access table (from this thread: http://www.access-programmers.co.uk/forums/showthread.php?p=607605#post607605 ).
It works as long as I have a Linked Table from the ODBC data source. If I remove all Linked Tables coming from the ODBC data source, exit Access, then re-launch Access (now with no Linked Tables) and run my VBA code I get an error stating that
But I [think] I have it in my code:
The error occurs at the last line you see in the code
I've checked all the variables in the Locals window and they are all populated when I step thru the VBA code. And it does work when ANY table from the ODBC source is Linked to my db. Is there a way around this so I don't have to have a table from my ODBC data source Linked?
It works as long as I have a Linked Table from the ODBC data source. If I remove all Linked Tables coming from the ODBC data source, exit Access, then re-launch Access (now with no Linked Tables) and run my VBA code I get an error stating that
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified."
Code:
Set objConn = New ADODB.Connection: Set objCommand = New ADODB.Command: Set objRecordSet = New ADODB.Recordset
ConnString = "Driver={" & DriverName & "};Server=" & WTServer & ";Port=80;"
ConnString = ConnString & "Database=expressAnalysis;Uid=" & UserID & ";Pwd=" & Password & ";AccountId=" & AccountID
ConnString = ConnString & ";Language=english;ProfileGuid=xewTL6f9Fw5.wlp;SSL = 0;"
objConn.Open ConnString 'Open a connection to the data source