Really stuck on this one - Please help

Results 1 to 3 of 3

Thread: Really stuck on this one - Please help

  1. #1
    Curtis Guest

    Default Really stuck on this one - Please help

    Ever since the server was upgraded to Win 2000 I can&#039t write to the MS Access 2000 data base. The addNew and Update methods just don&#039t work. <BR><BR>I get this error through error trapping:<BR><BR>* Operation is not allowed when the object is closed.<BR> <BR><BR>This is the code I use:<BR><BR>&#060;% <BR> &#039declare connection variables<BR> dim objConn<BR> dim objRec<BR><BR>on Error resume next<BR><BR> &#039create connection objects<BR> set objConn=Server.CreateObject ("ADODB.Connection")<BR> set objRec=Server.CreateObject ("ADODB.Recordset")<BR><BR>dbPath=Server.mappath(" lqcollegewebdatabase.mdb")<BR><BR> &#039make a DSNless connection to the database<BR> strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & dbPath<BR><BR> &#039open objects<BR> objConn.Open strConnect<BR> objRec.Open "tblComments", strConnect, adOpenKeyset, adLockPessimistic<BR><BR><BR>objRec.AddNew<BR>objR ec("LastName")=Request.Form("Lastname")<BR>objRec( "FirstName")=Request.Form("Firstname")<BR>objRec(" Address")=Request.Form("Address")<BR>objRec("City" )=Request.Form("City")<BR>objRec("Province")=Reque st.Form("Province")<BR>objRec("Country")=Request.F orm("Country")<BR>objRec("Telephone")=Request.Form ("Telephone")<BR>objRec("Email")=Request.Form("Ema il")<BR>objRec("Interest")=Request.Form("Interest" )<BR>objRec("Comments")=Request.Form("Comments")<B R>objRec("Date")=date<BR>objRec.Update<BR>objRec.C lose<BR><BR><BR><BR>Set ObjRec=Nothing<BR>Set objConn=Nothing<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Have you included reference to the

    Curtis<BR><BR>Quickie Question<BR><BR>Does your code include :<BR><BR>&#060;!--#include virtual="/PROGRAM FILES/COMMON FILES/SYSTEM/ADO/ADOVBS.INC"--&#062;<BR><BR>This constants file must be included on your asp page. If you wish to open your object via named constants, rather than thier ordinal numbers.<BR><BR>Gary<BR>

  3. #3
    Curtis Guest

    Default RE: Have you included reference to the

    Hi Gary:<BR>I have in same folder so I have:<BR><BR>&#060;!-- #include virtual= "/lqstcollege/" --&#062; at the top of the file.<BR><BR>I tried yours but I got an error of "path not found". Obviously that is not the right path from where my files are located.

Posting Permissions

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