"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter
"Like" and Dataadapter "Like" and Dataadapter
"Like" and Dataadapter
Go Back  Xtreme Visual Basic Talk > > > "Like" and Dataadapter


Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2004, 12:02 PM
scalijdub scalijdub is offline
Newcomer
 
Join Date: Aug 2003
Posts: 20
Default "Like" and Dataadapter


I'm having trouble with the dataadapter returning rows with this command using "Like." I'm using an access database 2002

SELECT tblpatient.fldmed_id, tblpatient.fldp_last, tblpatient.fldp_first
FROM tblpatient
WHERE (((tblpatient.fldp_last) Like [?]));

Any advice
Reply With Quote
  #2  
Old 08-19-2004, 05:22 PM
MKoslof's Avatar
MKoslof"Like" and Dataadapter MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Is "?" supposed to be a parameter? If so, where do you pass the physical parameter value to the command. Can you show us more of you code, such as where you instantiated your connection, command and dataAdapters?
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 08-19-2004, 09:34 PM
Optikal's Avatar
Optikal"Like" and Dataadapter Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

In ANSI SQL the wildcards are % and _ (not the * and ? that you are probably trying to use). Now, whether access supports the */? version, I'm not sure. But I bet using % and/or _ in your Access SQL would work.
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #4  
Old 08-20-2004, 04:39 AM
MKoslof's Avatar
MKoslof"Like" and Dataadapter MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Optikal:

In .Net "?" is a valid parameter definition for the Jet Provider. Though typically for SQL Server, Oracle and Access the "@paramName" is used. And considering he has no actual text, just the "?", I assume he is trying to build a parameterized query.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #5  
Old 08-23-2004, 03:02 PM
scalijdub scalijdub is offline
Newcomer
 
Join Date: Aug 2003
Posts: 20
Default

Quote:
Originally Posted by MKoslof
Optikal:

In .Net "?" is a valid parameter definition for the Jet Provider. Though typically for SQL Server, Oracle and Access the "@paramName" is used. And considering he has no actual text, just the "?", I assume he is trying to build a parameterized query.
Sorry, I forgot to state that I [?] is the parameter and I pass into it 'B*'
Reply With Quote
  #6  
Old 08-23-2004, 04:42 PM
MKoslof's Avatar
MKoslof"Like" and Dataadapter MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

OK for one...pass the wild card (and use "%") in your actual sql statement:

Code:
SELECT tblpatient.fldmed_id, tblpatient.fldp_last, tblpatient.fldp_first
FROM tblpatient WHERE tblpatient.fldp_last Like @param1%
Then make sure you pass the new parameter instance correctly:

Code:
'myCommand is your oledb command in this example, 'use whatever system data class you are currently implementing myCommand.Parameters.Add(New OleDbParameter("@param1", OleDbType.VarWChar, 25)) myCommand.Parameters("@param1").Value = "B"
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter "Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter "Like" and Dataadapter
"Like" and Dataadapter
"Like" and Dataadapter
 
"Like" and Dataadapter
"Like" and Dataadapter
 
-->