1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

'800a0401 error- vbscript insert into database

Discussion in 'Databases' started by YSeo, Nov 14, 2009.

  1. #1
    hey guys,

    I have a bit problem to executed a code . please help me.

    this is the code:

    Dim objRS, aConnectionString, DBObj
    sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & Server.MapPath("database1yaniv.mdb")
    Set DBObj=Server.CreateObject("ADODB.Connection")
    DBObj.ConnectionString = ""aConnectionStringDBO" ".Open
    SQLQuery = "INSERT * FROM forms123"
    Set objRS=DBObj.Execute(SQLQuery)
    objRS.AddNew
    objRS.Fields("name") = Request.Form("txtName")
    objRS.Fields("phone") = Request.Form("txtPhone")
    objRS.Fields("email") = Request.Form("txtEmail")
    objRS.Fields("Subject") = Request.Form("ddlSubject")
    objRS.Fields("Content") = Request.Form("txtcontent")
    objRS.Update
    objRS.Close
    Set objRS = nothing
    objConn.Close
    Set objConn = nothing


    this is the error I am getting:

    Microsoft VBScript compilation error '800a0401'

    Expected end of statement

    /Test.asp, line 22

    DBObj.ConnectionString = ""aConnectionStringDBO" ".Open
    ---------------------------^
    SEMrush

    thank you so much!
     
    YSeo, Nov 14, 2009 IP
    SEMrush
  2. thewebhostingdir

    thewebhostingdir Well-Known Member

    Messages:
    3,850
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    165
    #2
    It seems that there is some issue with your database connection string. Kindly replace the below connection string

    DBObj.ConnectionString = ""aConnectionStringDBO" ".Open

    with

    DBObj.ConnectionString = aConnectionStringDBO
    DBObj.Open

    Kindly have a try.
     
    thewebhostingdir, Nov 25, 2009 IP