Re: ADO 2.8 Command INSERT INTO with Date Parameter
- From: "." <someone@xxxxxxxxxxxx>
- Date: Mon, 8 May 2006 15:26:02 +0200
Hi Stephen,
I target both Access and SQL Server.
After extensive tests, I found a workaround to my issue. It doesn't seem to
be related with date issue but with either ADO, ADO / Access connection.
To clarify,
1/ First try
cmdtext = "INSERT INTO mytable(sample) VALUES(@sample)"
parameters.append .createparameter("@sample",addbdate,adinput)
execute ,dateserial(2005,02,18)
works fine.
2/ Second try:
cmdtext= "INSERT INTO mytable(sample,fKtable) SELECT @sample,
[table2].[pKTable2] from [table2] WHERE [table2].[field1]=@filter"
parameters.append .createparameter("@sample",addbdate,adinput)
parameters.append .createparameter("@filter",advarchar,adinput,50)
execute ,array(dateserial(2005,02,18),"what_ever"), adexecutenorecords
didn't work at all.
3/ Third Try using a Procedure
cmdtext="CREATE PROCEDURE [procTry] AS INSERT INTO mytable(sample,fKtable)
SELECT @sample, [table2].[pKTable2] from [table2] WHERE
[table2].[field1]=@filter"
execute ,,adexecutenorecord
then
cmdtext="EXECUTE [procTry]"
parameters.append .createparameter("@sample",addbdate,adinput)
parameters.append .createparameter("@filter",advarchar,adinput,50)
execute ,array(dateserial(2005,02,18),"what_ever"),adexecutenorecords
works perfectly.
Strange enough, isn't it?
Best
.
- References:
- ADO 2.8 Command INSERT INTO with Date Parameter
- From: .
- Re: ADO 2.8 Command INSERT INTO with Date Parameter
- From: Stephen Howe
- ADO 2.8 Command INSERT INTO with Date Parameter
- Prev by Date: Re: ADO 2.8 Command INSERT INTO with Date Parameter
- Next by Date: SQL to Bin one column and average another?
- Previous by thread: Re: ADO 2.8 Command INSERT INTO with Date Parameter
- Next by thread: Access Database is not accesable from VB 6.0
- Index(es):
Relevant Pages
|
|