Mackin, Christopher
CMackin at Quiznos.com
Fri May 14 11:09:26 CDT 2004
Try adding the dbo. prefix. So: rst.Open ("Select " & argFieldName & " FROM dbo.tblDeveloperConsole") Of course this is assuming that dbo created the table. -Chris Mackin -----Original Message----- From: Martin Reid [mailto:mwp.reid at qub.ac.uk] Sent: Friday, May 14, 2004 9:24 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Odd behaviour Working on a major revision to SQL Server Couple of problems still remaining. rst.Open ("Select " & argFieldName & " FROM tblDeveloperConsole") The above line when executed returns an error "Invalid Object Name" 'tblDeveloperConsole' The table is there. SPs work etc etc Am I doing something wrong in how I am trying to create the statement??? I need to pass a field name to the select at run time. Well several in fact. The var gets it value OK but the SQL Statement appears to be correct but isnt. This will be converted at some point to an SP. Martin _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com