Hi,
I am inserting info into a database and it does perform the insert, however, I am getting this error at the end of the action page:
ODBC Error Code = 21S01 (Insert value list does not match column list)
" [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same."
I am first inserting data in a users table, and then I am also adding the username variable into another table which are two separate queries.
The code to insert the data into a DB is as follows:
<CFQUERY DATASOURCE = "ONLINE" NAME="Search_DB">
SELECT UserName
FROM Users
WHERE Users.UserName = '#Form.UserName#'
</CFQUERY>
<HTML>
<HEAD>
<TITLE>Verification Details</TITLE>
</HEAD>
<BODY>
<!-- If Variable Username <> UserName entered by user then enter the details in the Users Table-->
<CFIF #SEARCH_DB.RECORDCOUNT# IS 0>
<CFQUERY DATASOURCE = "ONLINE">
INSERT INTO USERS (UserName, Name, Surname, Password, Email, PasswordReminderQuestion, PasswordReminderAnswer, UserDirectory)
VALUES ('#UserName#', '#Name#', '#Surname#', '#Password#', '#Email#', '#PasswordReminderQuestion#', '#PasswordReminderAnswer#', '#USERNAME#' )
</CFQUERY>
<!--- If the above expression is true i.e. no records of username in db, then the username value is also entered into the userspecific table --->
<CFQUERY DATASOURCE = "ONLINE">
INSERT INTO USERSPECIFIC (UserName)
VALUES ('#UserName#')
</CFQUERY>
<CFDIRECTORY ACTION ="Create" DIRECTORY = "c:\webshare\
The error above is then present in my other templates.
Any ideas??
Many thanks
Sam
I am inserting info into a database and it does perform the insert, however, I am getting this error at the end of the action page:
ODBC Error Code = 21S01 (Insert value list does not match column list)
" [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same."
I am first inserting data in a users table, and then I am also adding the username variable into another table which are two separate queries.
The code to insert the data into a DB is as follows:
<CFQUERY DATASOURCE = "ONLINE" NAME="Search_DB">
SELECT UserName
FROM Users
WHERE Users.UserName = '#Form.UserName#'
</CFQUERY>
<HTML>
<HEAD>
<TITLE>Verification Details</TITLE>
</HEAD>
<BODY>
<!-- If Variable Username <> UserName entered by user then enter the details in the Users Table-->
<CFIF #SEARCH_DB.RECORDCOUNT# IS 0>
<CFQUERY DATASOURCE = "ONLINE">
INSERT INTO USERS (UserName, Name, Surname, Password, Email, PasswordReminderQuestion, PasswordReminderAnswer, UserDirectory)
VALUES ('#UserName#', '#Name#', '#Surname#', '#Password#', '#Email#', '#PasswordReminderQuestion#', '#PasswordReminderAnswer#', '#USERNAME#' )
</CFQUERY>
<!--- If the above expression is true i.e. no records of username in db, then the username value is also entered into the userspecific table --->
<CFQUERY DATASOURCE = "ONLINE">
INSERT INTO USERSPECIFIC (UserName)
VALUES ('#UserName#')
</CFQUERY>
<CFDIRECTORY ACTION ="Create" DIRECTORY = "c:\webshare\
The error above is then present in my other templates.
Any ideas??
Many thanks
Sam