 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Cengis Guest
|
Posted: Mon Aug 30, 2004 3:14 pm Post subject: TAdoQuery parameters & empty strings |
|
|
hello,
i have a TAdoQuery for insert and update task in my access database
all parameters values are taken from TEdit
and the query is like 'INSERT INTO mytable(name,...) VALUES(:name,...);'
i use the following code to set parameters values:
myAdoQuery.parameters.parambyname('name').value := MyNameEdit.Text
it work fine when i don't have an empty string in the TEdit, but when
MyNameEdit.Text is empty i get an error (when i execute the query)
[microsoft][Driver ODBC Microsoft Access] value precision not valid
it seems to be specific to the tadoquery component, when i use TQuery
and BDE it work fine (with bde i use param.asString for exemple, but i
don't find where i can specify the conversion type for ADOQuery parameters)
any idea to fix that ?
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Mon Aug 30, 2004 3:53 pm Post subject: Re: TAdoQuery parameters & empty strings |
|
|
Use native provider for MS Access -
ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:test.mdb'
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Cengis" <cengis.kocaurlu (AT) prodiag (DOT) fr> ???????/???????? ? ???????? ?????????:
news:41334445$1 (AT) newsgroups (DOT) borland.com...
| Quote: | hello,
i have a TAdoQuery for insert and update task in my access database
all parameters values are taken from TEdit
and the query is like 'INSERT INTO mytable(name,...) VALUES(:name,...);'
i use the following code to set parameters values:
myAdoQuery.parameters.parambyname('name').value := MyNameEdit.Text
it work fine when i don't have an empty string in the TEdit, but when
MyNameEdit.Text is empty i get an error (when i execute the query)
[microsoft][Driver ODBC Microsoft Access] value precision not valid
it seems to be specific to the tadoquery component, when i use TQuery
and BDE it work fine (with bde i use param.asString for exemple, but i
don't find where i can specify the conversion type for ADOQuery
parameters)
any idea to fix that ?
|
|
|
| Back to top |
|
 |
Cengis Guest
|
Posted: Tue Aug 31, 2004 7:00 am Post subject: Re: TAdoQuery parameters & empty strings |
|
|
hmm i'll try this, thank you
Viatcheslav V. Vassiliev wrote:
| Quote: | Use native provider for MS Access -
ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:test.mdb'
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Cengis" <cengis.kocaurlu (AT) prodiag (DOT) fr> ???????/???????? ? ???????? ?????????:
news:41334445$1 (AT) newsgroups (DOT) borland.com...
hello,
i have a TAdoQuery for insert and update task in my access database
all parameters values are taken from TEdit
and the query is like 'INSERT INTO mytable(name,...) VALUES(:name,...);'
i use the following code to set parameters values:
myAdoQuery.parameters.parambyname('name').value := MyNameEdit.Text
it work fine when i don't have an empty string in the TEdit, but when
MyNameEdit.Text is empty i get an error (when i execute the query)
[microsoft][Driver ODBC Microsoft Access] value precision not valid
it seems to be specific to the tadoquery component, when i use TQuery
and BDE it work fine (with bde i use param.asString for exemple, but i
don't find where i can specify the conversion type for ADOQuery
parameters)
any idea to fix that ?
|
|
|
| Back to top |
|
 |
Cengis Guest
|
Posted: Wed Sep 01, 2004 8:15 am Post subject: Re: TAdoQuery parameters & empty strings |
|
|
Thank you Vassiliev V. V. it work fine, i just hope that will not create
new bugs :)
best regards
Cengis
Cengis wrote:
| Quote: | hmm i'll try this, thank you
Viatcheslav V. Vassiliev wrote:
Use native provider for MS Access -
ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:test.mdb'
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Cengis" <cengis.kocaurlu (AT) prodiag (DOT) fr> ???????/???????? ? ????????
?????????:
news:41334445$1 (AT) newsgroups (DOT) borland.com...
hello,
i have a TAdoQuery for insert and update task in my access database
all parameters values are taken from TEdit
and the query is like 'INSERT INTO mytable(name,...) VALUES(:name,...);'
i use the following code to set parameters values:
myAdoQuery.parameters.parambyname('name').value := MyNameEdit.Text
it work fine when i don't have an empty string in the TEdit, but when
MyNameEdit.Text is empty i get an error (when i execute the query)
[microsoft][Driver ODBC Microsoft Access] value precision not valid
it seems to be specific to the tadoquery component, when i use TQuery
and BDE it work fine (with bde i use param.asString for exemple, but i
don't find where i can specify the conversion type for ADOQuery
parameters)
any idea to fix that ?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|