submitting data to a database and incrementinting the p... - 3/15/2001 20:59:00
PLEASE HELP ME SOMEONE? I AM STUCK HERE. I HAVE TRIED TO WORK THIS OUT FOR MONTHS. UNTIL I DISCOVERED OUTFRONT.NET. I am submitting data from a form (using Frontpage 2000)to a database in Access 2000.The ODBC connection is working as far as I know. The table that is updated has a primary key (of a text data type using the format - AR-118, AR-119). Also in the database is a module that automatically increments the primary key, whenever a new record is entered. The module used is copied from the microsoft's knowledgebase and can be found at http://support.microsoft.com/support/kb/articles/Q209/8/30.ASP?LN=EN-US&SD=gn&FR=0&qry=how%20do%20you%20increment%20a%20numeric%20string&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000 . In order for this module to work a record should be inputted to start the primary key such as AR-110. Every time a user submits data from the form, it should be submitted to the table. It should also be given a primary key such AR-111. When a second user submits data to the same table, the primary key should automatically be incremented by 1 such as AR-112. The problem is that when data is submitted to database I am given the following error message: Cannot update the database Error Description: [Microsoft][ODBC Microsoft Access Driver]Error in row Error Number: -2147217873 Error Source: Microsoft OLE DB Provider for ODBC Drivers. Note: The pages used and the database are hosted by a hosting company. If I need to make changes of any kind I need to contact them. IF I change the primary key data type to autonumber, the primary key is updated and all data is successfully submitted to teh data base. There is nothing wrong with the other fields such as telephone number, date and time, they are working fine.
I can't use the autonumber data type, because I have three tables and their Primary key needs to be unique such as AR- 111, DP-111, TR-111. PLEASE HELP ME SOMEONE I AM IN DESPERATE NEED OF THE ANSWER.
|