Results 1 to 3 of 3

Thread: SQL Database Code Error. Help Quick please.

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking

    With this code
    Code:
    '--Enter emails in DB
    
    	Dim Dconn, sSQL, sSQL2, sSQL3, cmDC, SQL, Recordset
    			
    	Set Dconn = Server.CreateObject("ADODB.Connection")
    		Dconn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & _
    		               databasepath & ";"
    		               
    	Set cmdDC = Server.CreateObject("ADODB.Command")
    		cmdDC.ActiveConnection = Dconn
    		
    	SQL = "SELECT * FROM Emails"
    			
    	SQL = "Select * FROM Sender.Email WHERE " & "Sender.Email ='" & SenderEmail & "'" 
    			
    	cmdDC.CommandText = SQL
    	Set RecordSet = Server.CreateObject("ADODB.Recordset")
    
    +++++++++RecordSet.Open cmdDC, , 3, 3

    I get this error:


    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] Could not find file 'C:\WINNT\system32\Sender.mdb'.
    /bbb.org/emailer/EmailIn.asp, line 111
    ---------------------------------------
    line 111 marked with +++++++++

    I have a DB named Emails.mdb that has the path
    Code:
    Const databasepath c:/inetpub/wwwroot/bbb.org/emailer/emails.mdb

    Why is it looking for 'C:\WINNT\system32\Sender.mdb'?

    Help!

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Dont know. what is the variable databasepath set to?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking

    is this what you mean?

    Code:
    Const databasepath = "c:/inetpub/wwwroot/bbb.org/emailer/emails.mdb"

Posting Permissions

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



Click Here to Expand Forum to Full Width