Ask a Question related to Coldfusion Database Access, Design and Development.
-
cshow365 #1
Trouble inserting date into database
The date format in the form being submitted is mm/dd/yyyy.
Below is the error I'm getting.
Any help would make me really happy!
Thanks
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Too few parameters. Expected 2.
Error occurs in line 42
40 : '#Trim(FORM.Frequency)#',
41 : #FORM.FrequencyUnitsID#,
42 : #CreateODBCDate(FORM.DateTaken)#)
43 : </cfquery>
:o
cshow365 Guest
-
Trouble Inserting Page Spreads
I always have a real hard time inserting page spreads into a document. What am I doing wrong? Say I have a 20 page magazine document. If I want to... -
inserting date into MySql Database
I am trying to insert the current date into a MySql database. I know that the date format for MySql is yyyy-mm-dd . So far I have tried to insert... -
Trouble inserting data in database
I use DW 2004, XP with sp2, and Access 2003. Im planning to make a site that is possible to log in and update news from the web. So I have made a... -
Inserting Current Date into MySQL Database
OK, I am a complete Newbie at this, well... almost... I am creating a database that accepts members. I need to know how to insert the date of... -
inserting the current date into mysql database fild
Hi I'm using DW MX and the php_mysql server model I have generated this code for inserting data into the DB. <code> if... -
mxstu #2
Re: Trouble inserting date into database
Can you post the query code and the actual sql statement sent to the database from the error message (it contains the actual values submitted).
mxstu Guest
-
cshow365 #3
Re: Trouble inserting date into database
Here it is!
<cfquery datasource="#APPLICATION.dataSource#">
INSERT INTO Drugs(UserID,
DrugName,
Dose,
DoseUnits,
Frequency,
FrequencyUnitsID,
DateTaken)
VALUES(#SESSION.auth.UserID#,
#FORM.DrugName#,
'#Trim(FORM.Dose)#',
#FORM.DoseUnits#,
'#Trim(FORM.Frequency)#',
#FORM.FrequencyUnitsID#,
#CreateODBCDate(DateTaken)#)
</cfquery>
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Too few parameters. Expected 2.
The error occurred in C:\CFusionMX7\wwwroot\Project
Alpha\drugs091805\drug_insert1.cfm: line 42
40 : '#Trim(FORM.Frequency)#',
41 : #FORM.FrequencyUnitsID#,
42 : #CreateODBCDate(DateTaken)#)
43 : </cfquery>
44 :
--------------------------------------------------------------------------------
SQL INSERT INTO Drugs(UserID, DrugName, Dose, DoseUnits, Frequency,
FrequencyUnitsID, DateTaken) VALUES(3, DRUG1, '2', mg, '2', 1, {d
'2005-09-18'})
DATASOURCE Drugs
VENDORERRORCODE -3010
SQLSTATE 07002
cshow365 Guest
-
mxstu #4
Re: Trouble inserting date into database
I don't think the problem is the date. I think you are just missing single
quotes around some of the form values. If you are inserting into a "text"
column, you must use single quotes. If it is a "numeric" column then you do
not need single quotes.
VALUES(3, DRUG1, '2', mg, '2', 1, {d '2005-09-18'})
mxstu Guest
-



Reply With Quote

