Need help connecting. Invalid object name '..

Results 1 to 2 of 2

Thread: Need help connecting. Invalid object name '..

  1. #1
    Join Date
    Dec 1969

    Default Need help connecting. Invalid object name '..

    Hi,<BR>I am working on a project for school where I have to make ASP pages. My pages are on the same server as the DB (MSSQL). We have to use a DSN-Less connection. I can get the pages to connect but when I try to access the tables I get this error: Invalid object name &#039....&#039 Here is my code:<BR><BR> Set DataConn=Server.CreateObject("ADODB.connection")<B R> myDSN = "driver=SQL Server;server=CISTEST;database=keyfb09;User ID=(userID);password=(password)" <BR> mySQL = "select * from policynum"<BR> set conntemp=server.createobject("adodb.connection")<B R> myDSN<BR> set rstemp=conntemp.execute(mySQL)<BR><BR>What am I doing wrong????<BR>Any help will be greatly appreciated. I am going insane!!<BR><BR>Thanks.<BR>Johnny.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Need help connecting. Invalid object name �

    This is probably you are using different variable names,<BR>when you say:<BR>set dataconn=Server.CreateObject("ADODB.connection")<B R>----------------------------<BR>then next line should be <BR>-----------------------------<BR> = "driver=SQL Server;server=CISTEST;database=keyfb09;User ID=(userID);password=(password)" <BR>Also same thing with recordset, you dont need to set conntemp again, just your sql statement and then<BR>-----<BR>set rstemp=connect.execute(sql)<BR>--------------------------------------<BR>Hope this helps.<BR>Good Luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts