Connecting to an access database with a table link

Results 1 to 2 of 2

Thread: Connecting to an access database with a table link

  1. #1
    Join Date
    Dec 1969

    Default Connecting to an access database with a table link

    I have a Database in Access 2000 with a table in it that links to an oracle database. I&#039;m trying to connect to the table but it requires a username and password. I&#039;m having trouble with the syntax of the username and password.<BR><BR>Here is how I connect to the database:<BR><BR>&#060;% dim strConnect, oConn, oRS<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ= e:pubinternetdatabaseCompanies.mdb;"<BR>set oConn = server.createobject("ADODB.connection")<BR>set oRS = server.createobject("ADODB.recordset")%&#062;<BR>< BR>Here is my SQL statement<BR>oRS.Open "SELECT * FROM LOCUSER_LOC_ADDRESSES WHERE StateID = &#039;" & sState & "&#039;", strConnect, "username", "password",2,3<BR><BR>As of now I keep getting an error saying<BR><BR>Microsoft VBScript runtime error &#039;800a01c2&#039; <BR>Wrong number of arguments or invalid property assignment: &#039;Open&#039; <BR><BR><BR>Any help is appreciated

  2. #2
    Join Date
    Dec 1969

    Default Sure can't do it that way!

    WHere did you ever see *anything* in the ADO docs that implied that you could pass the userid and password to ADODB.RecordSet.Open????<BR><BR>YOu can pass them to ADODB.CONNECTION.Open, but that&#039;s completely different.<BR><BR>You *might* be able to make this work by putting them into the strConnect, but I have no idea how linked dbs like this work.<BR><BR>[Why do you bother with the oConn connection object if you then ignore it and use the string in the oRS.Open???]<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts