Writing to a database

Results 1 to 3 of 3

Thread: Writing to a database

  1. #1
    Join Date
    Dec 1969

    Default Writing to a database

    Hello, Can someone please give me some insight. All I am trying to do is write records to an access database. I cannot find any of this basic help anywhere. Here is my code and it just does not work??<BR><BR>&#060;%<BR> Dim oConn, rsUsers, vCS, sqltext, strVariable<BR> Set oConn = Server.CreateObject("ADODB.Connection")<BR> vCS = "Provider=Microsoft.Jet.OLEDB.4.0"<BR> vCS = vCS & "; Data Source=D:wwwrootmanagedata est.mdb"<BR> oConn.connectionstring = vCS<BR> oConn.Open<BR> strVariable = request.form("Variable")<BR><BR> Set rsUsers = Server.CreateObject("ADODB.Recordset")<BR> sqltext = "SELECT * FROM Test;"<BR> rsUsers.Open sqltext,oConn<BR> <BR> rsUsers("Variable") = strVariable<BR> rsUsers.Update<BR>%&#062;<BR><BR><BR>Thanks for the input!!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Writing to a database

    You are opening the database up as readonly, update to this line, notice the #&#039s at the end<BR><BR>rsUsers.Open sqltext,oConn,0,3<BR><BR>You should try a search on locktypes and cursors, that will get you on the right track.

  3. #3
    Join Date
    Dec 1969

    Default insert

    for adding records u will have to learn to use insert sql command, so u don&#039t have to create recordsets.<BR>

Posting Permissions

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