Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Command Error 80040e0c I need help


Message #1 by "Brad Stokes" <brad.stokes@t...> on Thu, 29 Aug 2002 03:16:32
Hi, 

I've been trying to figure this one out, I keep getting the same error and 
my brain is in 

shutdown. can someon help.
DB Error 80040e0c is driving me insane, Please help

The code is as follows (Option explicit is on)

dim qryStr, rsQry 
 
dim dbConnect, strDB 
 
strDB="" 'set the connection string strDB = "Driver={Microsoft Access 
Driver (*.mdb)};" &_ 
        " DBQ=D:\inetpub\wwwroot\cnj\dbsource\sddb.mdb;uid=SA;pwd=;" 
        dbConnect= null 
        'initialise the DB Connection 
        Set dbConnect = server.CreateObject("ADODB.Connection") 
    'Open the connection 
    dbConnect.Open strDB
 
qryStr = "UPDATE tblUsers " & _ 
    " SET " & _ 
    " name ='" & Request.Form("fname") & _ 
    "', surname ='" & Request.Form("fsurname") &_
     "', username='" & Request.Form("fusername") & _
     "', password='" & Request.Form("fpassword") &_ 
    "', access='"  & Request.Form("faccess") &_    
     "', email='" & Request.Form("femail") &_    
     "', phone='" & Request.Form("fphone") &_    
     "', fax='" & Request.Form("ffax") &_ 
        "', mobile='" & Request.Form("fmobile") &_
     "', section='" & Request.Form("fsection") &_
     "', campus='" & Request.Form("fcampus") &_ 
    "' WHERE userid = " & int(Request.QueryString("uid")) &";" 
    Response.Write "<BR> " & qryStr 
 
    set rsQry = server.CreateObject("ADODB.Command") 
    rsQry.ActiveConnection =    dbConnect
    rsQry.CommandText = qryStr 
    rsQry.CommandType = adCmdText 
    rsQry.Execute , , adExecuteNoRecords


Can Someone tell me what I'm doing wrong

CHeers
Brad
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 29 Aug 2002 17:12:22 +1000
Some hints:

a) Plase post the actual error message you are receiving. Some error numbers
can have multiple error messages associated with them

b) Please post the actual SQL string that is output from Response.Write() -
this is so we can see what is actually being sent to the database (you will
need to put Response.End in after Response.Write() so that the code doesn't
bomb later on)

c) You should never use reserved words like "Password" for
variable/field/table names - it can cause all sorts of problems, and you
need to make extra efforts to ensure that your code/database knows that
these are literals, eg:

    SELECT
        [Password]
    FROM
        Table1

Better would be UserPassword, or FirstName (rather than Name)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Brad Stokes" <brad.stokes@t...>
Subject: [asp_databases] Command Error 80040e0c I need help


: Hi,
:
: I've been trying to figure this one out, I keep getting the same error and
: my brain is in
:
: shutdown. can someon help.
: DB Error 80040e0c is driving me insane, Please help
:
: The code is as follows (Option explicit is on)
:
: dim qryStr, rsQry
:
: dim dbConnect, strDB
:
: strDB="" 'set the connection string strDB = "Driver={Microsoft Access
: Driver (*.mdb)};" &_
:         " DBQ=D:\inetpub\wwwroot\cnj\dbsource\sddb.mdb;uid=SA;pwd=;"
:         dbConnect= null
:         'initialise the DB Connection
:         Set dbConnect = server.CreateObject("ADODB.Connection")
:     'Open the connection
:     dbConnect.Open strDB
:
: qryStr = "UPDATE tblUsers " & _
:     " SET " & _
:     " name ='" & Request.Form("fname") & _
:     "', surname ='" & Request.Form("fsurname") &_
:      "', username='" & Request.Form("fusername") & _
:      "', password='" & Request.Form("fpassword") &_
:     "', access='"  & Request.Form("faccess") &_
:      "', email='" & Request.Form("femail") &_
:      "', phone='" & Request.Form("fphone") &_
:      "', fax='" & Request.Form("ffax") &_
:         "', mobile='" & Request.Form("fmobile") &_
:      "', section='" & Request.Form("fsection") &_
:      "', campus='" & Request.Form("fcampus") &_
:     "' WHERE userid = " & int(Request.QueryString("uid")) &";"
:     Response.Write "<BR> " & qryStr
:
:     set rsQry = server.CreateObject("ADODB.Command")
:     rsQry.ActiveConnection =    dbConnect
:     rsQry.CommandText = qryStr
:     rsQry.CommandType = adCmdText
:     rsQry.Execute , , adExecuteNoRecords
:
:
: Can Someone tell me what I'm doing wrong
:
: CHeers
: Brad


  Return to Index