|
best -> RE: Writing Timestamp to Access via ASP (8/15/2004 15:45:00)
|
hi, i'm new to asp. i need some help here.i want to insert timestamp to my database(access) in my timestamp field(type is Date/Time) . i read all ya previous posts, and tried to slove it myself. well basically i was able to write out e sql statement , but was not able to insert into DB. kinda weird that i couldnt close e connection. pls look into my code. desperately need help. .ty in advance quote:
<% dim strName dim strRegnick dim strHdd dim strConn dim strRec Dim strUptime Dim strServe Dim mySQL Dim conn dim adoCon strName=Request.Form("nick") strRegnick=Request.Form("regnick") strHdd=Request.Form("hdd") strConn=Request.Form("conn") strRec=Request.Form("rec") strUptime=Request.Form("uptime") strServe=Request.Form("serve") Set adoCon = Server.CreateObject("ADODB.Connection") conn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("databases/xiso.mdb") adoCon.Open conn Set rs = SERVER.CreateObject("ADODB.Recordset") mySQL = "INSERT INTO reg (nick,regnick,hdd,conn,rec,uptime,serve,[Timestamp]) VALUES ( '"& strName &"' , '"& strRegnick &"' , '"& strHdd &"' , '"& strConn &"' , '"& strRec &"', '"& strUptime &"', '"& strServe &"')" mySQL= mySQL & "',('" & Now() & ")" 'conn.Execute mySQL 'conn.Close 'rs.Open mySQL, conn 'Set conn = Nothing response.write mySQL %>
|
|
|
|