Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2006, 01:19 PM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error INSERT INTO

I'm trying to insert new row into Access database in vb.net. My insert into statement is like this where strjobno(string type) comes from textbox.

"insert into MasterJobT(job#,jobstartdate,projectedcompletionda te) values ('" & strJobNo & "',#01/10/2002#,#01/10/2002#)"

when I execute query it gine me 'Syntax error INSET INTO' statement.

How to solve this problem? Do u guys see any syntax error in there?

Thanks

 
Old January 31st, 2006, 05:32 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi ITladybug,
Check the data type of job# if it's number change the string as

"insert into MasterJobT(job#,jobstartdate,projectedcompletionda te) values (" & strJobNo & ",#01/10/2002#,#01/10/2002#)"

If still you are getting an error please let us know the error number and the description


nalaka hewage
 
Old January 31st, 2006, 07:50 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by nalla


Hi ITladybug,
Check the data type of job# if it's number change the string as

"insert into MasterJobT(job#,jobstartdate,projectedcompletionda te) values (" & strJobNo & ",#01/10/2002#,#01/10/2002#)"

If still you are getting an error please let us know the error number and the description


nalaka hewage

Thanks for the reply. Job# is of type string. I've another question. I've column of type currency. I've declare variable with type decimal to store currency value. Am I correct ? PLease help me to solve this 'INSERT INTO' syntax error.

Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error when using "Insert Into" Luis Access VBA 14 November 18th, 2008 03:09 PM
Syntax Error on Insert dalezjc Classic ASP Basics 29 June 20th, 2007 06:50 PM
Syntax error in INSERT INTO statement. kingleon Classic ASP Basics 1 May 10th, 2005 06:25 PM
INSERT syntax error ss2003 PHP Databases 1 October 7th, 2004 05:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.