Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC - Connection to test Failed

Status
Not open for further replies.

mozgheib

Programmer
Dec 14, 2003
50
KW
Good morning,

I have a linked table inside my mdb, using an
odbc driver that links to my Oracle 8 server.
Now when I try to programatically connect to
my linked table I get the error "ODBC - Connection to test Failed" despite the fact my odbc driver is properly configured and when I manually try to open the link it works just fine.

Kindly see me code below :


Dim db As DAO.Database
Dim tdf As DAO.TableDef

Set db = CurrentDb()
Set tdf = db.CreateTableDef("ORION_PS_STAGING_DATA")
tdf.SourceTableName = "ORION_PS_STAGING_DATA"

tdf.Connect = "ODBC;DATABASE=scd;UID=orion;PWD=orion;DSN= oriontest;"

db.TableDefs.Append tdf
db.TableDefs.Refresh

Set tdf = Nothing
Set db = Nothing
 
This is exactly what I use to make connections. I have the DSN parameter before the Database parameter but I don't think the order is important. I would copy exactly the .connect string from your code and manually put it into the .connect string in the table and see if it works then.

Otherwise, it is something other than the code.

Post back with the results of your continued testing. I may be going to sleep soon as it is almost 2 am here in Michigan. See you in the morning my time.

Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top