PC Review


Reply
Thread Tools Rate Thread

Criteria Expression in vb.net

 
 
=?Utf-8?B?RExlbmVlQGFvbC5jb20uY29tLihkb25vdHNwYW0p
Guest
Posts: n/a
 
      1st Aug 2004
I am trying to create a parameterized query and it keeps giving me an error "Datatype error in expression" when I enter = @ChildID or =?ChildID. The ? is supposed to be the wildcard for Access SQL.

I am using an Access database that uses an autonumber field as the primary key for a table. The data adapter on the data tier is based on a table called tblChild. The field is ChildID. I'm trying to enter it in the CommandText property of the SelectCommand.

I tried entering info in the criteria for another integer autonumber field and had the same error message.

It appears to work ok in the string fields though.

Is this a problem with autonumber fields in Access being used in VB.net?
Does anyone have any suggestions at all??? If there's a knowledge base
article, please point me to it. I have been unable to find anything.

Thanks!


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      1st Aug 2004
Hi Donotspam,

You can start here with finding your solution.

http://msdn.microsoft.com/library/de...ClassTopic.asp

Next time you can better ask this in the newsgroup

microsoft.public.dotnet.framework.adonet
and vbnet related
microsoft.public.dotnet.languages.vb

When you think it is both or even to this newsgroup related you can
crosspost, that is sending one message to all subject related groups.

I hope this helps,

Cor


 
Reply With Quote
 
=?Utf-8?B?RExlbmVlQGFvbC5jb20uY29tLihkb25vdHNwYW0p
Guest
Posts: n/a
 
      1st Aug 2004
Hi Cor,

I figured it out. I only needed to use ?, rather than include the field name too.
Thanks for tips.

Have a good day.


"Cor Ligthert" wrote:

> Hi Donotspam,
>
> You can start here with finding your solution.
>
> http://msdn.microsoft.com/library/de...ClassTopic.asp
>
> Next time you can better ask this in the newsgroup
>
> microsoft.public.dotnet.framework.adonet
> and vbnet related
> microsoft.public.dotnet.languages.vb
>
> When you think it is both or even to this newsgroup related you can
> crosspost, that is sending one message to all subject related groups.
>
> I hope this helps,
>
> Cor
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
expression with more than 1 criteria =?Utf-8?B?cmFzY2Fs?= Microsoft Access Queries 3 5th Nov 2006 11:23 PM
data type mismatch in criteria expression when no criteria specified JR Microsoft Access Queries 1 27th Jul 2004 03:47 AM
Criteria expression Microsoft Access Queries 2 9th Jul 2004 01:22 AM
Criteria Expression geohawk Microsoft Access Queries 1 7th Apr 2004 10:45 AM
Re: Macro Error: & "Function is not available in expression in criteria expression" Douglas J. Steele Microsoft Access 1 4th Aug 2003 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:37 AM.