View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
James McDowell[_2_] James McDowell[_2_] is offline
external usenet poster
 
Posts: 29
Default DSN Connection with OpenRecorset

Hello,

I am trying to write code that will define the ODBC connection. No problem
there.
I have created a workspace and then defined the connection to use my user ID
and password (to allow other to access data otherwise not available).

My problem is that my SQL that works if I have a regular database object and
openrecordset object no longer works. Do I have to modify the SQL since I am
using a connection object in place of the database object?

The changes that I am aware of is that Access will append the database name
to the beginning of the table.field string ( example: myTABLE.fieldname now
looks like dbMYDATABSE_myTABLE.fieldname).

I have a condition in my SQL on a field that houses dates. In my code that
portion of the SQL looked like ..."(mydatabase_mytable.OOSDATE Date() )"
This worked just fine for the past few weeks. But now that I have defined
the connection and tit gives me a runtime error "3146 ODBC--Call Failed"


I have done a simple query on another database table and the connection
object worked fine.
Can anyone help?

Thank you