Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO question

Status
Not open for further replies.

ivalum21

MIS
Jul 14, 2004
63
0
0
US
Here is my query:

Code:
	INSERT INTO Car_Checkout
		(CEmp_ID,CCar_ID,Date_Out,Date_In,Odometer_before,Odometer_after,Destination,Miles_Travelled,Business,Personal)
	VALUES
		(#form.EmpID#, #car_id#, #CreateODBCDate(form.StartDate)#, NULL, #form.car_present_odometer#, NULL,
	 	'#form.Destination#', NULL,'#form.Business#','#form.Personal#')

When I run this query, nothing gets inserted into my database. Any ideas why?
 
could be 1 of many reasons, 1 being that the account that the datasource is using does not have INSERT privileges.

Is a blank record created or no record created? Does it throw an error?


=========================================
I have not failed. I've just found 10,000 ways that won't work.
Thomas A. Edison
 
Are you sure the query is running? Can we see some surrounding code?

And, as NorthStarDA said, are you getting any errors?

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
No errors and no blank records. I'm using an Access database, and when i go into my database to the correct table....there is nothing.
 
Have you tried to insert data directly into the database using the SQL statement but with values entered where the form values are? If this works, check the form to see where the info is going.

Erwin Oosterhoorn
Analyst Programmer,
ice hockey player/fan.
 
If you have Admin rights to the CF server enable Debug to see the output of the query after the page runs.

If not surround your CFQUERY with CFOUTPUT for a bit, or copy the block of code but use a CFOUTPUT. Anyhow, what you need to do is to get the actual query string being passed to your DB.

See exactly what you get and then try to copy/paste it on Access. If there's a query problem Access should give you a more informative message.



grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top