Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Brisbane
    Posts
    14

    Unanswered: empty string connection

    Why would I be getting an empty string connection with the following code?

    I want to use DSN. Is this the problem?

    strType=Request.form("Type")
    strArea=Request.form("Area")
    strFirstName=Request.form("FirstName")
    strLastName=Request.form("LastName")
    stremail=Request.form("email")
    strDate=Date
    strComments=Request.form("Comments")
    strDBType = "access"
    Set objConn = Server.CreateObject("ADODB.Connection")
    StrConnString = "comments.mdb" '## DSN
    ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("comments.mdb")
    objConn.Open ConnectionString

    sqlQuery = "SELECT * FROM Comments"
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open sqlQuery, objConn, 1, 2

    objRS.AddNew
    objRS("Type")=strType
    objRS("Area")=strArea
    objRS("FirstName")=strFirstName
    objRS("LastName")=strLastName
    objRS("email")=stremail
    objRS("SubmitDate")=strDate
    objRS("comments")=strcomments

    objRS.Update
    objRS.Close
    Set objRS = Nothing

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Could you please post your error message
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

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