Ok, this is probably a real noobie question but its twisting my head.
So far I have only ever used access databases with my code. However I now have a task that involves our SQL server databases.
For this reason I decided to use the "Data Form Wizard" to give me a good starting point.
I created an ODBC connection to the DB...which tests out successfully.
The data form wizard see the database...sees the tables....which then lets me select the fields from the table to use....all looking good so far....
but when I try to Run the resulting form i get an "Invalid Object Name" for the tablename I selected.
code as below. - modified the SQL statement for privacy and ease of read.
Code:
db.Open "PROVIDER=MSDASQL;dsn=SQLAdv;uid=admin;pwd=password;database=DBname;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from table1 Order by LoginName", db, adOpenStatic, adLockOptimistic
now this error is fumbling me....because obviously the table exists and works as the data form wizard lets me select it.
Thanks in advance for advice. This is probably something dead simple that I missed