max
Tue Jan 30 08:22:22 CST 2007
Hi,
"Bart Mermuys" <bmermuys.nospam@hotmail.com> ha scritto nel messaggio
news:90svh.316241$oW6.6302842@phobos.telenet-ops.be...
>
> Hi,
>
> "max" <max@max.max> wrote in message
> news:Qk%th.21862$bH4.13666@tornado.fastwebnet.it...
>>
>> Hi Robin,
>> I have an access db; in my form I have a textbox; on it, click on data
>> menu, added a new query, gave it a name and put it in query text:
>> SELECT * FROM table WHERE name LIKE name + '*' (I'm not really sure it's
>> the right syntax for querying an access db).
>
> Try:
>
> SELECT * FROM table WHERE [name] LIKE ? + '%'
>
> JET uses unnamed parameters (?) and % as wildcards.
>
> HTH,
> Greetings
It works fine!
I just add a query from the TableAdapter Icon using the query wizard, paste
the code you wrote, then designer adds a button and a textbox, and I wrote
on it just some digit to get the results I was expecting!
It was an Access issue. I didn't expect it was so hard to work with Access
db in VS2005, I find only sql samples in internet...
Do you know a place where I can learn more about SQL statements for Access
db in a VS2005 environment?
Thanks a lot Bart!!!
Max.
>
>> Closing the form, it adds a search button and a FillByNameToolStrip
>> object.
>> My target is to write a partial text in the textbox, clilck to the button
>> just created, and get all the names that start for my partial text, ie: I
>> type just "bro" to get all the names starting from "bro" (brown, browns,
>> brother etc.). It sounds very simple. Using the SELECT instruction above,
>> and start compiling app, I get this:
>>
>> "Too many arguments for "Public Overridable Overloads Function
>> FillByName(dataTable As demoDataSet.myTableDataTable) As Integer"
>>
>> Here is the autogenerated vb code about the fill statement:
>>
>> Private Sub FillByNameToolStripButton_Click(ByVal sender As
>> System.Object, ByVal e As System.EventArgs) Handles
>> FillByNameToolStripButton.Click
>> Try
>> Me.MyTableAdapter.FillByName(Me.demoDataSet.MyTable,
>> NameToolStripTextBox.Text)
>> Catch ex As System.Exception
>> System.Windows.Forms.MessageBox.Show(ex.Message)
>> End Try
>> End Sub
>>
>> I just need to get the result as indicated. I welcome any other methos,
>> if it exists. I'm trying to use designer for most of the job in vb
>> programming. Probably it's not the best method...
>>
>> Thanks.
>>
>> "RobinS" <RobinS@NoSpam.yah.none> ha scritto nel messaggio
>> news:s9udncmBQpYeAyrYnZ2dnUVZ_r-onZ2d@comcast.com...
>>>
>>> Can you post your code, or a small subset of the code
>>> showing the query stuff?
>>>
>>> Robin S.
>>> ------------------
>>> "max" <max@max.max> wrote in message
>>> news:ARpth.18500$bH4.6269@tornado.fastwebnet.it...
>>>>
>>>> If I do that:
>>>> SELECT * FROM table WHERE name LIKE name + '*'
>>>>
>>>> I get an error when starting compiling application:
>>>> "Too many arguments for "Public Overridable Overloads Function
>>>> FillByName(dataTable As demoDataSet.myTableDataTable) As Integer".
>>>> It reminds in a VB line:
>>>> "Me.MyTableTableAdapter.FillByName(Me.demoDataSet.myTable,
>>>> NameToolStripTextBox.Text)",
>>>> in which the error is underlined on "NameToolStripTextBox.Text". This
>>>> is the textbox where I digit the items to search for in my db.
>>>>
>>>> Help would be appreciated.
>>>> Thanks.
>>>>
>>>>
>>>> "Shkedy" <shkedy@newsgroups.nospam> ha scritto nel messaggio
>>>> news:Og9IhOoPHHA.1248@TK2MSFTNGP03.phx.gbl...
>>>>>
>>>>> The wildcard character in Jet-SQL (Access) is * and not %
>>>>> That should do it
>>>>>
>>>>> Sagi Shkedy
>>>>>
http://Blog.shkedy.com
>>>>> "Max" <nobody@devnull.spamcop.net> wrote in message
>>>>> news:45b54784$0$7735$5fc30a8@news.tiscali.it...
>>>>>> Hello,
>