Problems Connection to Access database

Results 1 to 2 of 2

Thread: Problems Connection to Access database

  1. #1
    Join Date
    Dec 1969

    Default Problems Connection to Access database

    Hi,<BR><BR>I am encountering problems with connecting to Access using ASP. What I did was, I add an Entry into the System DNS from ODBC Data source (32) with the name ME1 which points to the actual ME1.mdb, then the following codes to open and add in records. I am sure there&#039s something wrong with my codes but I do not know how to solve it.<BR><BR>I read some documentation from as suggested in one of the posting to someone, but i just cannot understand... maybe some part of my brain is blocked... :-( <BR><BR>1. Error occurs in "Order" conn,?,? --- is Conn considered the connection string ? and if my .mdb file does not have password, is it ok to leave it blank ?<BR><BR>Any help is greatly appreciated.<BR><BR>Thanks & Regds,<BR><BR>Wilson <BR><BR>*-------------<BR>&#060;% <BR>upMultiArray=Session("MultiArray")<BR>upCurren tElement=Session("CurrentElement")<BR>upPreview=Se ssion("Preview")<BR><BR>dim zOrderID<BR>dim zLineID<BR>dim zRevisionID<BR><BR>set conn=server.createobject("ADODB.connection")<BR>se t RS=Server.createobject("ADODB.Recordset")<BR>conn. open "ME1"<BR><BR> "Order" conn,,<BR>RS.addnew<BR>RS("OrderNum")=upPreview(0, 1)<BR>RS("OrderDate")=upPreview(1,1)<BR>RS("requir edETADate")=upPreview(15,1)<BR>RS("placerID")="1"< BR>RS("ContainerTotal")=upPreview(17,1)<BR>RS("sta tusID")="1"<BR>RS("EntryMode")="M"<BR>RS("Remarks" )="xxx"<BR>RS.update<BR>zOrderID=RS("OrderID")<BR> RS.close<BR>set RS=nothing<BR><BR> "Revision"<BR>RS.AddNew<BR>RS("OrderID")=zOrderID< BR>RS("version")=0<BR>RS("revisionDate")=sysdate() <BR>RS("revisedBy")="1"<BR>RS.Update<BR>zRevisionI D=RS("revisionID")<BR>RS.Close<BR>set RS=nothing<BR><BR>RS.Open "RevisedOrder"<BR>RS("revisionID")=zRevisionID<BR> RS("requiredETADate")=upPreview(15,1)<BR>RS("Conta inerTotal")=upPreview(17,1)<BR>RS.Update<BR>RS.Clo se<BR>set RS=nothing<BR><BR>sql = "Update Order set revisionID=" & zRevisionID & ";"<BR>DataCmd.CommandText = sql<BR>set RS=DataCmd.execute<BR>set RS=nothing<BR><BR>DataConn.Close<BR>session.abando n<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Problems Connection to Access database

    yes, conn is considered the connection string<BR><BR>don&#039t include commas after the open call unless you actually include an argument. if there is no password, leave it blank.<BR><BR>you&#039d actually be better off not using dsn&#039s to connect to access - there are tutorials on this on<BR><BR><BR>www.4guysfromrolla.c om<BR><BR><BR><BR>j

Posting Permissions

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