Problems with Generic Form Handler-Newbie!

Results 1 to 3 of 3

Thread: Problems with Generic Form Handler-Newbie!

  1. #1
    Join Date
    Dec 1969
    Posts
    1,364

    Default Problems with Generic Form Handler-Newbie!

    I copied the Form Handler, followed advise word-for-word, and yet I&#039m still getting this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Can&#039t repeat table name &#039Tbl_species_info&#039 in FROM clause. <BR><BR>/sp_Pages/database_add.asp, line 34<BR><BR><BR>And offers of help!!!<BR>TIA<BR>Dan

  2. #2
    Sathiya Guest

    Default RE: Problems with Generic Form Handler-Newbie!

    Can you show the Code<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    1,364

    Default RE: Problems with Generic Form Handler-Newbie!

    It is exactly the same as from the webpages here, the variable TableName is being passed from a hidden inputtype where the value="Tbl_species_info"<BR><BR>&#039Our ADO constants we&#039ll need<BR>Const adOpenForwardOnly = 0<BR>Const adLockOptimistic = 3<BR>Const adCmdTable = &H0002<BR><BR><BR>&#039Create our connection object and open a connection to our database<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR><BR>obj Conn.ConnectionString = "DSN=MarLIN_data_entry"<BR>objConn.Open<BR><BR><BR >&#039Create a recordset object<BR>Dim objRS<BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR><BR>&#03 9Open a table view for the table name specified by Request("TableName")<BR>Dim strTableName<BR>strTableName = Request("TableName")<BR><BR>objRS.Open strTableName, objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable<BR><BR><BR>&#039Add a new record...<BR>objRS.AddNew<BR><BR>&#039Iterate through the fields of the table...<BR>Dim fld<BR>For Each fld in objRS.Fields<BR> &#039If a value for the column name was passed in,<BR> &#039set the column name equal to the value passed through the form...<BR> if Len(Request(fld.Name)) &#062; 0 then<BR> fld.Value = Request(fld.Name)<BR> end if<BR>Next<BR><BR>&#039We&#039re done, so update the record<BR>objRS.Update<BR><BR><BR>&#039Clean Up...<BR>objRS.Close<BR>Set objRS = Nothing<BR><BR>objConn.Close<BR>Set objConn = Nothing<BR>%&#062;<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
  •