Access and System DNS connection

Results 1 to 3 of 3

Thread: Access and System DNS connection

  1. #1
    Curt Precilla Guest

    Default Access and System DNS connection

    Hi Guys<BR><BR>Me again. I have a HTML form that sends six pieces of data to an ASP page (via the POST attribute). The ASP page retrieves the values of the variables via the Request.form(x) format. <BR><BR>I am getting the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Field &#039feedback.Area&#039 cannot be a zero-length string. <BR>/thanks.asp, line 31 <BR><BR>The following is my asp code:<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;%<BR>&#039This section retrieves the values submitted in the form<BR><BR>location=Request.Form("area")<BR>act=R equest.Form("use")<BR>trys=Request.Form("attempts" )<BR>rates=Request.Form("speed")<BR>serve=Request. Form("service")<BR>comm=Request.Form("comments")<B R><BR>&#039Opens connection with the database<BR><BR>Dim objConn<BR>Set objConn=Server.CreateObject("ADODB.Connection")<BR >objConn.ConnectionString="DSN=feedback"<BR>objCon n.Open<BR><BR>&#039Inserts form values into database<BR><BR>dim str<BR><BR>str = "INSERT INTO feedback (area, use, attempts, speed, service, comments) VALUES(&#039" & location & "&#039,&#039" & act & "&#039,&#039" & trys & "&#039,&#039" & rates & "&#039,&#039" & serve & "&#039,&#039" & comm & "&#039)"<BR>objConn.Execute (str)<BR><BR>&#039Closes connection with database<BR><BR>objConn.close<BR>%&#062;<BR><BR>I have stuck with using a system DNS because I can&#039t understand the DSN-less format. I using Access2000 for bldg my database and I am running Personal Web Server on Windwos 98. If this works I will have to port it to WinNT4.0/IIS platform. Can this setup work.<BR><BR>Getting desperate.<BR><BR>Sincerely <BR>Curt Precilla <BR><BR>ps The HTML form uses five radio buttons and a textarea. This matches up to five text fields and one memo field in my database.<BR>The database uses an autonumber field as the primary key. <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Access and System DNS connection

    Perhaps this site will help you<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Access and System DNS connection

    Hi Curt,<BR><BR>Here is good DNS-less code.<BR><BR>Set conn = Server.CreateObject("ADODB.connection")<BR>DSNtemp ="DRIVER={Microsoft Access Driver (*.mdb)}; "<BR>DSNtemp=dsntemp & "DBQ=" & server.mappath("databasename.mdb")<BR>conn.Open DSNtemp<BR><BR>Opens up a DSNless connection to your database (change the database reference name to the name of your database) and then open your recordset etc.<BR><BR>The reason you are getting the error above is because your field is set to "allow zero length" - No.<BR><BR>To change this - open your database in design view. Go to the fields data type and choose "Allow Zero Length" YES.<BR><BR>HTH<BR>Renee :)

Posting Permissions

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