![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello: MSAccess 2000 sql server backend. I have an append query(in vba) that is appending to a sql server table. There are 3 tables in the query, one of them is an access table. When I run the query I get the Invalid Object Message (referencing the access table). Any ideas on what I can do to program vba to recognize the access table? below is a scaled down version of my code: Function updatebinarytbl() Dim strSql As String Dim cn As ADODB.Connection Set cn = New ADODB.Connection cn.Open "DSN=SSDB", "SA", "sa" |
|
strSql = "INSERT INTO sqlTBL1 (sqlfld1, sqlfld2, sqlfld3) " & _ "SELECT sqlTBL2.fld1, sqlTBL3.fld1, sqlTBL3.fld2 " & _ "FROM (sqlTBL2 JOIN fld ON sqlTBL2.fld = sqlTBL3.fld) INNER JOIN accessTBL ON sqlTBL2.fld = accessTBL.fld " & _ |
#3
| |||
| |||
|
|
Hello: MSAccess 2000 sql server backend. I have an append query(in vba) that is appending to a sql server table. There are 3 tables in the query, one of them is an access table. When I run the query I get the Invalid Object Message (referencing the access table). Any ideas on what I can do to program vba to recognize the access table? below is a scaled down version of my code: Function updatebinarytbl() * *Dim strSql As String * *Dim cn As ADODB.Connection * *Set cn = New ADODB.Connection * *cn.Open "DSN=SSDB", "SA", "sa" strSql = "INSERT INTO sqlTBL1 (sqlfld1, sqlfld2, sqlfld3) " & _ "SELECT sqlTBL2.fld1, sqlTBL3.fld1, sqlTBL3.fld2 " & _ "FROM (sqlTBL2 JOIN fld ON sqlTBL2.fld = sqlTBL3.fld) INNER JOIN accessTBL ON sqlTBL2.fld = accessTBL.fld " & _ cn.Execute strSql cn.Close Set cn = Nothing End Function |
#4
| ||||
| ||||
|
|
Hi Unfortunately I have limited access to resources. |
|
Althought I know how to use Analyzer and Enterprise very well, I don't have them here. |
|
Those the are the configurations I was to told to use when accessing the database. |
|
I will try to get this to succeed using a query object with linked tables (odbc). |
#5
| |||
| |||
|
|
Tony_E wrote: Hi Unfortunately I have limited access to resources. No you don't *You have the sa password. You have unlimited access. You can do anything on that sql server. Althought I know how to use Analyzer and Enterprise very well, I don't have them here. Why is that relevant? I only brought up those client tools to illustrate a point I was making. Should I assume you are using SQL 2000? You don't need EM or QA for any of my recommentations. Everything I suggested can be implemented by running some T-SQL statements using a passthrough query. Those the are the configurations I was to told to use when accessing the database. Then you have a dba who is putting your company's data at risk. Does he realize you've revealed the sa password to the world? I will try to get this to succeed using a query object with linked tables (odbc). Again, that's one approach. Hopefully it will perform well for you. |
![]() |
| Thread Tools | |
| Display Modes | |
| |