BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TAdoQuery parameters & empty strings

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Cengis
Guest





PostPosted: Mon Aug 30, 2004 3:14 pm    Post subject: TAdoQuery parameters & empty strings Reply with 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
Viatcheslav V. Vassiliev
Guest





PostPosted: Mon Aug 30, 2004 3:53 pm    Post subject: Re: TAdoQuery parameters & empty strings Reply with 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...
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





PostPosted: Tue Aug 31, 2004 7:00 am    Post subject: Re: TAdoQuery parameters & empty strings Reply with quote



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





PostPosted: Wed Sep 01, 2004 8:15 am    Post subject: Re: TAdoQuery parameters & empty strings Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.