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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating SQL DB from MS Access Tables?

Status
Not open for further replies.

squirleegirl

Programmer
Jun 24, 2003
59
US
I've got a program that updates a sql database with the information from MS Access tables. Now this program is currently in use and works fine. Well, you know Microsoft, and I'm using the program on a different server with different databases and it is no longer working.

Problem is, I didn't write the program and the person who did is not available for assistance, so I'm running blind here.

I've linked all of my tables correctly. I've got regular tables and dbo(?) tables. My ODBC connections are correct and the dbo tables are pointing to the right dsn.

The VBA code in MS Access is:

DoCmd.OpenQuery ("qryDroptblTable")
DoCmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=mydsn;uid=myuid;pwd=mypwd" & "Database=mydatabase", acTable, "tblTable", "tblTable"

The query only consists of one drop statement with no conditions. When I run the program, I get the following error:
Run-time error 3146
ODBC--call failed
[Microsoft][ODBC Sql Server Driver][Sql Server]Cannot drop the table 'tblTable', because it does not exist in the system catalog (#3701)

The tables are in the sql server, so I don't know what to do. This is not my area, but somehow got stuck with it =-)

Does anyone have any suggestions on what I can do? Are there steps I missed in linking the tables or something?
Do I need to do something with the system catalog?

Any suggestions would be greatly appreciated.
 
Be sure and use the dbo prefix for the linked table you are trying to change - all the dbo tables are the linked ones (with the cute little globe icons).
 
So in the docmd.transferdatabase statement use the "dbo_tblTable" for the sql table? Like this....

DoCmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=mydsn;uid=myuid;pwd=mypwd" & "Database=mydatabase", acTable, "tblTable", "dbo_tblTable"
 
I tried dbo_tblTable and dbo.tblTable and neither worked. I got the same error =-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top