Invalid connection string in pass through query

aznewsh

New member
Local time
Today, 12:20
Joined
Apr 10, 2008
Messages
2
Run time error '3305'

Invalid connection string in pass through query

I have inherited an Access database which seems to be having problems connecting to an Oracle table. It successfully connects to the Oracle table in other Subs but the one having problems uses a different method to connect that I am not familiar with, if I debug it shows the line pasted below as being the problem:

qdf.Connect = "DRIVER={Oracle in OraHome92};SERVER=******;UID=******;PWD=******;DBQ=******;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"

in the following context:

Set qdf = dbs.CreateQueryDef("qUnique", strSQL)
qdf.SQL = strSQL
qdf.Connect = "DRIVER={Oracle in OraHome92};SERVER=******;UID=******;PWD=******;DBQ=******;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"
qdf.ODBCTimeout = 0
qdf.ReturnsRecords = True

' Open query in Datasheet view.
DoCmd.OpenQuery qdf.Name
Set RS = dbs.QueryDefs("qUnique").OpenRecordset

Whereas the following connection works fine:

strConnectString = "driver={Oracle in OraHome92};DBQ=******;UID=******;PWD=******; "
Set wrkODBC = DBEngine.Workspaces(0)
Set dbDW = wrkODBC.OpenDatabase("", False, True, strConnectString)
dbDW.Close

Any help is appreciated, if more info is required feel free to ask.
 
Found the problem - somehow ODBC; had been deleted from the start of the connection string, hope this helps somebody in the future.
 

Users who are viewing this thread

Back
Top Bottom