Discussion Locked

Access and ODBC

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a RS6000 that we have a program that we can create an ODBC datasource. I need to extract data into Access 2000. I can link to the ODBC connection but how do I query to actually get any data. I am able to use Microsoft Query and Extract to Excell, but how do I do it in Access?

10 replies

by ideafixer

I know nothing about rs6000. Does it have tables? Sorry about the vauge answer, but have you tried, in access, file -> get external data -> link tables ? If you can't link, you could allways import the data and refresh on occasion. Let me know what happens.

by dont-bother

RS6000 mini-computers are a 'totally different animal' than Windows PCs entirely.

What you need to do:
1.) Export the RS6000 database to a .csv (comma delimited file) or other common format that Access accepts. (You'll have to consult your RS6000 database docs/expert/IBM to accomplish this.

2.) Import the common-format file into Access

That's how we did it, only we used MS SQL Server instead of Access.

The program you have that allows you to create an ODBC datasource should provide tutorials/procedures/docs on how to utilize it IF you need a 'pseudo-realtime' connection.
That RS6000 program is proprietary to the company you purchased it from. ONLY they can help you, unless you find someone using the EXACT same program in asimilar scenerio.

by dont-bother

If you can use MSQuery and import the data to Excel, you should be able to do the same thing using MS Query to extract to a .csv file, then import into Access, or by using accessdb.mdb instead of xlfilename.xls...

by dennisbv

I am trying to eliminate the Exporting to One file then into Access. That is what we are doing now. I want to be able to Query and retrive right to Access.

by glen_mcleod

If you can create an ODBC DSN to your datasource and connect succesfully from MSQuery, then you can use exactly the same DSN with Access and some ADO code:

Dim sConString as String
Dim conRS6K as ADODB.Connection

'replace dsnName, userName, userPassword with the actual values
sConString
= "Provider=MSDASQL;DSN=dsnName;UID=userName;PWD=userPassword;"
conRS6K.ConnectionString = sConString
conRS6K.Open

You can then execute commands and return the results into ADO recordset objectsDim rs as ADODB.Recordset
'execute your SQL command
Set rs = conRS6K.Execute("SQL Statement")

Glen

by dennisbv

I keep recieving the error "Object variable or With Block variable not set"
Here is what I had
sConString = " Provider=Transoft;DSN=nds.udd;UID=#####;PWD=########;"
conRS6k.ConnectionString = sConString 'This is where the error is

conRS6k.Open

by glen_mcleod

Where did you get "Provider=Transoft;"? In my original answer, I said to use "Provider=MSDASQL;" Have you tried that? It's the ODBC provider for AOLDB. I have no Idea what "Transoft" might be...

Glen

by dennisbv

Transoft is the driver we use for our dsn which is nds.udd is the dsn source we connect to. I changed to code back to your example and I still recieve the same error

This discussion is closed to new replies.