If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > empty string connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-03, 19:48
davep23 davep23 is offline
Registered User
 
Join Date: Dec 2003
Location: Brisbane
Posts: 14
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
Reply With Quote
  #2 (permalink)  
Old 12-22-03, 06:10
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
Could you please post your error message
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On