myComm = New OleDbCommand("Insert into mytest2 select * from mytest " & dtsql, myConn)
Dim na As
Integer = myComm.ExecuteNonQuery()
+++++++++++++++++++++++++
Although "insert into mytest2 value(bla,bla)" works fine.
what can be the problem??
Thanks for looking into the matter.
dateasp.netms accessInsert into SQLinsert methodaccess oledbSELECT command
Your Where clause lacks delimiters for the value you are trying to pass in - unless its a number datatype, which I doubt. Try using parameters. They are safer, and don't need delimiters:
None
0 Points
19 Posts
Using Access ,localhost and date query with subquery ignores shorting
Apr 26, 2008 02:47 PM|bishnoi|LINK
I m trying to use a localhost,asp and local Access DB with a subquery:
TxtFrom TxtTo are textboxes
+++++++++++++++++++++++++++
Dim
dtsql As String Dim dteStarting As Date dteStarting = CType(TxtFrom.Text, Date) Dim dteEnding As DatedteEnding =
CType(TxtTo.Text, Date)dtsql =
"WHERE mytest.st_dt > " & dteStarting.ToShortDateStringAlthough "insert into mytest2 value(bla,bla)" works fine.
what can be the problem??
Thanks for looking into the matter.
date asp.net ms access Insert into SQL insert method access oledb SELECT command
Bishnoi
Tantra Mantra Yantra
All-Star
194511 Points
28081 Posts
Moderator
Re: Using Access ,localhost and date query with subquery ignores shorting
Apr 26, 2008 03:59 PM|Mikesdotnetting|LINK
Your Where clause lacks delimiters for the value you are trying to pass in - unless its a number datatype, which I doubt. Try using parameters. They are safer, and don't need delimiters:
http://www.mikesdotnetting.com/Article.aspx?ArticleID=26
None
0 Points
19 Posts
Re: Using Access ,localhost and date query with subquery ignores shorting
Apr 27, 2008 09:32 AM|bishnoi|LINK
Thanks.
Got it.
Bishnoi
Tantra Mantra Yantra