473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Parameter it doesn't work (for me) II

Fia
Hi again
I tried the code below and know the CommandText looks like it should from
the Trace,
but I still don't get any records.
When I'm running the SQL statement in the Access database I get records.

sökaOrdCom = New OleDbCommand("Select * from kött where köttid Like " & "'"
& PubStr & "*'", DBConn)
sökaOrdRead = sökaOrdCom.ExecuteReader
Trace.WriteLine(sökaOrdCom.CommandText)

Do While sökaOrdRead.Read
recCount += 1 'this code never happens
Loop

I don't get this, please help me.

Fia
Nov 21 '05 #1
5 823
No problem just to keep it in one thread
Nov 21 '05 #2
As you were told last time you posted this question, the wildcard for like
in ADO and ADO.NET is %, not *.
"Fia" <fi*****@telia.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi again
I tried the code below and know the CommandText looks like it should from
the Trace,
but I still don't get any records.
When I'm running the SQL statement in the Access database I get records.

sökaOrdCom = New OleDbCommand("Select * from kött where köttid Like " &
"'"
& PubStr & "*'", DBConn)
sökaOrdRead = sökaOrdCom.ExecuteReader
Trace.WriteLine(sökaOrdCom.CommandText)

Do While sökaOrdRead.Read
recCount += 1 'this code never happens
Loop

I don't get this, please help me.

Fia

Nov 21 '05 #3
> As you were told last time you posted this question, the wildcard for like
in ADO and ADO.NET is %, not *.

What has AdoNet to do with a select string?

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

Thanks for posting in this thread while there is an earlier one with the
same message by the way.

Cor
Nov 21 '05 #4
From the page you indicated:

<quote>
Note The % and _ (underscore) wildcard characters should be used only
through the Jet OLE DB provider and ActiveX® Data Objects (ADO) code. They
will be treated as literal characters if they are used though the Access SQL
View user interface or Data Access Objects (DAO) code.
</quote>

There is a very good reason for this and that is because ADO (both flavours)
specifies % and _ as the wildcard characters in SQL statements. * and ? just
don't work. Whatever the rights, wrongs or indifferences, it is a fact of
life.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
As you were told last time you posted this question, the wildcard for
like in ADO and ADO.NET is %, not *.

What has AdoNet to do with a select string?

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

Thanks for posting in this thread while there is an earlier one with the
same message by the way.

Cor

Nov 21 '05 #5
Fia
Thank's now it works!!!

Fia
"Stephany Young" <noone@localhost> skrev i meddelandet
news:%2******************@TK2MSFTNGP14.phx.gbl...
From the page you indicated:

<quote>
Note The % and _ (underscore) wildcard characters should be used only
through the Jet OLE DB provider and ActiveX® Data Objects (ADO) code. They
will be treated as literal characters if they are used though the Access SQL View user interface or Data Access Objects (DAO) code.
</quote>

There is a very good reason for this and that is because ADO (both flavours) specifies % and _ as the wildcard characters in SQL statements. * and ? just don't work. Whatever the rights, wrongs or indifferences, it is a fact of
life.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
As you were told last time you posted this question, the wildcard for
like in ADO and ADO.NET is %, not *.

What has AdoNet to do with a select string?

http://msdn.microsoft.com/library/de.../acfundsql.asp
Thanks for posting in this thread while there is an earlier one with the
same message by the way.

Cor


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: jose.jeria | last post by:
I just started looking at XSLT, so bare with me if I totally misunderstood this. I am passing a value to the xslt that i want to use to search in some nodes. I have the following code for this...
6
by: Hoschi-Ingo | last post by:
Hello NG, I want to write a generic function to validate data in input items. For this I want to pass a refernce to the object which calls this function to read out the and modify it if...
4
by: Steve Smith | last post by:
I need to add an additional String parameter to a Java SP (DB2 8.1 0 using DB2 Development Center - FP4). Everytime I do this I get the following error message when building:-...
8
by: Dave Veeneman | last post by:
Can I pass a method pass one of its out parameters to another method? C# is telling me I can't. Let's say I have two methods, FooManager and FooWorker. FooManager is part of a class that acts as...
5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
2
by: pbd22 | last post by:
can somebody tell me how to set a parameter of my current URL without using response.redirect? I am trying to set a parameter - ResponseId = 4 inside a while loop. is this possible? also,...
3
by: highab | last post by:
Hello, I want to send a parameter (string) to an external js file. I found something very similar to what I wanted with you but it doesn't answer my question, so here goes: I call my...
13
by: masso600 | last post by:
char word; in = fopen("test.txt", "r"); while(fscanf(in,"%s",&word)!=EOF) { /* Print all words */ /* printf("%s\n",&word); */
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.