Hello,
I just have a form in which there's a textbox for queries. I need to use the
SQL statements for an Access db, like this, which works fine in a SQL db:
SELECT * FROM table WHERE name LIKE @name + '%'
I just need to query the db to find names that start with letters I digit in
the textbox.
This query comes from dataset designer. If I use it in my Access db I get a
syntax error from framework. Which is the Access equivalent?
Thanks.
Max

Re: Queries to an Access db from vs2005 by Shkedy

Shkedy
Mon Jan 22 18:15:44 CST 2007

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,
> I just have a form in which there's a textbox for queries. I need to use
> the SQL statements for an Access db, like this, which works fine in a SQL
> db:
> SELECT * FROM table WHERE name LIKE @name + '%'
> I just need to query the db to find names that start with letters I digit
> in the textbox.
> This query comes from dataset designer. If I use it in my Access db I get
> a syntax error from framework. Which is the Access equivalent?
> Thanks.
> Max
>
>



Re: Queries to an Access db from vs2005 by max

max
Tue Jan 23 09:28:40 CST 2007


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,
>> I just have a form in which there's a textbox for queries. I need to use
>> the SQL statements for an Access db, like this, which works fine in a SQL
>> db:
>> SELECT * FROM table WHERE name LIKE @name + '%'
>> I just need to query the db to find names that start with letters I digit
>> in the textbox.
>> This query comes from dataset designer. If I use it in my Access db I get
>> a syntax error from framework. Which is the Access equivalent?
>> Thanks.
>> Max
>>
>>
>
>
>




Re: Queries to an Access db from vs2005 by max

max
Wed Jan 24 10:34:34 CST 2007


Anybody can help?

Thanks.
Max

"max" <max@max.max> ha scritto nel messaggio
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,
>>> I just have a form in which there's a textbox for queries. I need to use
>>> the SQL statements for an Access db, like this, which works fine in a
>>> SQL db:
>>> SELECT * FROM table WHERE name LIKE @name + '%'
>>> I just need to query the db to find names that start with letters I
>>> digit in the textbox.
>>> This query comes from dataset designer. If I use it in my Access db I
>>> get a syntax error from framework. Which is the Access equivalent?
>>> Thanks.
>>> Max
>>>
>>>
>>
>>
>>
>
>
>
>




Re: Queries to an Access db from vs2005 by RobinS

RobinS
Wed Jan 24 11:59:31 CST 2007

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,
>>> I just have a form in which there's a textbox for queries. I need to
>>> use the SQL statements for an Access db, like this, which works fine
>>> in a SQL db:
>>> SELECT * FROM table WHERE name LIKE @name + '%'
>>> I just need to query the db to find names that start with letters I
>>> digit in the textbox.
>>> This query comes from dataset designer. If I use it in my Access db
>>> I get a syntax error from framework. Which is the Access equivalent?
>>> Thanks.
>>> Max
>>>
>>>
>>
>>
>>
>
>
>



Re: Queries to an Access db from vs2005 by max

max
Thu Jan 25 04:07:52 CST 2007


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).
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,
>>>> I just have a form in which there's a textbox for queries. I need to
>>>> use the SQL statements for an Access db, like this, which works fine in
>>>> a SQL db:
>>>> SELECT * FROM table WHERE name LIKE @name + '%'
>>>> I just need to query the db to find names that start with letters I
>>>> digit in the textbox.
>>>> This query comes from dataset designer. If I use it in my Access db I
>>>> get a syntax error from framework. Which is the Access equivalent?
>>>> Thanks.
>>>> Max
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>




Re: Queries to an Access db from vs2005 by Paul

Paul
Thu Jan 25 09:39:37 CST 2007

On Thu, 25 Jan 2007 11:07:52 +0100, "max" <max@max.max> wrote:

¤
¤ 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).
¤ 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...

One of the first problems you will encounter is a reserved word issue. The column "name" is a Jet
reserved word so you will either need to rename the column or enclose it in brackets. As was
mentioned in a previous post, the wild card character for ADO is a percent symbol and not an
asterisk.


Paul
~~~~
Microsoft MVP (Visual Basic)

Re: Queries to an Access db from vs2005 by max

max
Thu Jan 25 10:15:13 CST 2007


Name is just 'something'. In my vb code it's 'Nome'.

"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto nel
messaggio news:itihr29mgcl70b2gapvfnhka3vos38ugv1@4ax.com...
> On Thu, 25 Jan 2007 11:07:52 +0100, "max" <max@max.max> wrote:
>
> ¤
> ¤ 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).
> ¤ 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...
>
> One of the first problems you will encounter is a reserved word issue. The
> column "name" is a Jet
> reserved word so you will either need to rename the column or enclose it
> in brackets. As was
> mentioned in a previous post, the wild card character for ADO is a percent
> symbol and not an
> asterisk.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>




Re: Queries to an Access db from vs2005 by max

max
Fri Jan 26 12:03:00 CST 2007


Anybody help?

"max" <max@max.max> ha scritto nel messaggio
news:dJ4uh.22581$bH4.10020@tornado.fastwebnet.it...
>
>
> Name is just 'something'. In my vb code it's 'Nome'.
>
> "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto nel
> messaggio news:itihr29mgcl70b2gapvfnhka3vos38ugv1@4ax.com...
>> On Thu, 25 Jan 2007 11:07:52 +0100, "max" <max@max.max> wrote:
>>
>> ¤
>> ¤ 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).
>> ¤ 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...
>>
>> One of the first problems you will encounter is a reserved word issue.
>> The column "name" is a Jet
>> reserved word so you will either need to rename the column or enclose it
>> in brackets. As was
>> mentioned in a previous post, the wild card character for ADO is a
>> percent symbol and not an
>> asterisk.
>>
>>
>> Paul
>> ~~~~
>> Microsoft MVP (Visual Basic)
>>
>
>
>
>




Re: Queries to an Access db from vs2005 by RobinS

RobinS
Fri Jan 26 13:55:49 CST 2007

I'm thinking about it. I haven't given up yet.

Robin S.
------------------------------
"max" <max@max.max> wrote in message
news:goruh.24509$bH4.11223@tornado.fastwebnet.it...
>
> Anybody help?
>
> "max" <max@max.max> ha scritto nel messaggio
> news:dJ4uh.22581$bH4.10020@tornado.fastwebnet.it...
>>
>>
>> Name is just 'something'. In my vb code it's 'Nome'.
>>
>> "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto
>> nel messaggio news:itihr29mgcl70b2gapvfnhka3vos38ugv1@4ax.com...
>>> On Thu, 25 Jan 2007 11:07:52 +0100, "max" <max@max.max> wrote:
>>>
>>> ¤
>>> ¤ 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).
>>> ¤ 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...
>>>
>>> One of the first problems you will encounter is a reserved word
>>> issue. The column "name" is a Jet
>>> reserved word so you will either need to rename the column or
>>> enclose it in brackets. As was
>>> mentioned in a previous post, the wild card character for ADO is a
>>> percent symbol and not an
>>> asterisk.
>>>
>>>
>>> Paul
>>> ~~~~
>>> Microsoft MVP (Visual Basic)
>>>
>>
>>
>>
>>
>
>
>



Re: Queries to an Access db from vs2005 by Paul

Paul
Mon Jan 29 09:08:53 CST 2007

On Thu, 25 Jan 2007 17:15:13 +0100, "max" <max@max.max> wrote:

¤
¤ Name is just 'something'. In my vb code it's 'Nome'.
¤

Unless you post the exact statement, including the actual column names you are using, it will be
very difficult to troubleshoot the problem.


Paul
~~~~
Microsoft MVP (Visual Basic)

Re: Queries to an Access db from vs2005 by max

max
Mon Jan 29 10:11:49 CST 2007


I repost this, with the actual column names:
I have an Access2003 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 tblPatients WHERE nome LIKE nome + '*' (I'm not really sure
it's the
right syntax for querying an access db).
Closing the form, it adds a search button and a FillByNomeToolStrip 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
FillByNome(dataTable As demoDataSet.tblPatientsDataTable) As Integer"

Here is the autogenerated vb code about the fill statement:

Private Sub FillByNomeToolStripButton_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
FillByNomeToolStripButton.Click
Try
Me.tblPatientsAdapter.FillByNome(Me.demoDataSet.tblPatients,
NomeToolStripTextBox.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.


"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto nel
messaggio news:9d3sr2lh5193a3503ie1cibrsum3a56m7g@4ax.com...
> On Thu, 25 Jan 2007 17:15:13 +0100, "max" <max@max.max> wrote:
>
> ¤
> ¤ Name is just 'something'. In my vb code it's 'Nome'.
> ¤
>
> Unless you post the exact statement, including the actual column names you
> are using, it will be
> very difficult to troubleshoot the problem.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>




Re: Queries to an Access db from vs2005 by Bart

Bart
Mon Jan 29 13:35:33 CST 2007

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

> 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,
>>>>> I just have a form in which there's a textbox for queries. I need to
>>>>> use the SQL statements for an Access db, like this, which works fine
>>>>> in a SQL db:
>>>>> SELECT * FROM table WHERE name LIKE @name + '%'
>>>>> I just need to query the db to find names that start with letters I
>>>>> digit in the textbox.
>>>>> This query comes from dataset designer. If I use it in my Access db I
>>>>> get a syntax error from framework. Which is the Access equivalent?
>>>>> Thanks.
>>>>> Max
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>



Re: Queries to an Access db from vs2005 by RobinS

RobinS
Mon Jan 29 17:41:10 CST 2007

Although I've read this at least a dozen times, I'm still confused.

The form you're talking about is in VS2005, not in Access, right? Access is
just your back-end data source.

So you have a Windows Form (?) with a textbox on it where the user is going
to put in search criteria, like "bro" for "bro*" (e.g. Brown).

I'm not sure how you added the query you're talking about. This doesn't
sound right for Visual Studio. You clicked on the Data Menu -- what did you
add? A new Data Source that is a query? Is this like a stored procedure?
It's a query definition in Access?

Because it looks like you're trying to do some kind of stored procedure, in
which case it should accept a parameter, and you should pass the parameter.

Please give us more specifics.

Robin S.
---------------------------------------------------------------

"max" <max@max.max> wrote in message
news:12pvh.29343$bH4.16252@tornado.fastwebnet.it...
>
> I repost this, with the actual column names:
> I have an Access2003 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 tblPatients WHERE nome LIKE nome + '*' (I'm not really sure
> it's the
> right syntax for querying an access db).
> Closing the form, it adds a search button and a FillByNomeToolStrip
> 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
> FillByNome(dataTable As demoDataSet.tblPatientsDataTable) As Integer"
>
> Here is the autogenerated vb code about the fill statement:
>
> Private Sub FillByNomeToolStripButton_Click(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles
> FillByNomeToolStripButton.Click
> Try
> Me.tblPatientsAdapter.FillByNome(Me.demoDataSet.tblPatients,
> NomeToolStripTextBox.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.
>
>
> "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto nel
> messaggio news:9d3sr2lh5193a3503ie1cibrsum3a56m7g@4ax.com...
>> On Thu, 25 Jan 2007 17:15:13 +0100, "max" <max@max.max> wrote:
>>
>> ¤
>> ¤ Name is just 'something'. In my vb code it's 'Nome'.
>> ¤
>>
>> Unless you post the exact statement, including the actual column names
>> you are using, it will be
>> very difficult to troubleshoot the problem.
>>
>>
>> Paul
>> ~~~~
>> Microsoft MVP (Visual Basic)
>>
>
>
>



Re: Queries to an Access db from vs2005 by max

max
Tue Jan 30 05:28:30 CST 2007


Hi Robin,

"RobinS" <RobinS@NoSpam.yah.none> ha scritto nel messaggio
news:BbKdnVVw8dqLGyPYnZ2dnUVZ_qyjnZ2d@comcast.com...
>
> Although I've read this at least a dozen times, I'm still confused.
>
> The form you're talking about is in VS2005, not in Access, right? Access
> is just your back-end data source.

That's right.

> So you have a Windows Form (?) with a textbox on it where the user is
> going to put in search criteria, like "bro" for "bro*" (e.g. Brown).

Yes, it's a Windows Form, I dragged a textbox on it.

> I'm not sure how you added the query you're talking about. This doesn't
> sound right for Visual Studio. You clicked on the Data Menu -- what did
> you add? A new Data Source that is a query? Is this like a stored
> procedure? It's a query definition in Access?
> Because it looks like you're trying to do some kind of stored procedure,
> in which case it should accept a parameter, and you should pass the
> parameter.

I'm working with VS2005. I had put a textbox bounded from datasource and,
clicking on it, the Data menu was showing a "Add query" item. But it doesn't
work and it gave me the
"Too many arguments for Public Overridable Overloads Function
FillByNome(dataTable As demoDataSet.tblPatientsDataTable) As Integer". So
forget it.
Then I tried a second option: right click to TableAdapter icon, Add query,
and using the query wizard, I wrote this:
SELECT * FROM tblPatients WHERE Nome LIKE Nome + '*'
Next, I gave a name to the query, "FillByNome", and a name to the DataTable,
"GetDataBy".
It added a ToolStripButton on my form called "FillByNomeToolStripButton".
Then, on the same toolstrip, using the "Add items" button close to the
button just created, I added a textbox, called "ToolStripTextBox"; then I
run the application, I see all my records in a DataGridView contol in my
Form, and when I fill the textbox with "bro", and clicked on the button, the
entire collection of records showing names disappears. So the query doesn't
work.
Then, I changed the query by right-clicking "Configure" on the query name in
the tblPatients in DataSet designer, and changed as it:
SELECT * FROM tblPatients WHERE (Nome LIKE [@WriteNome] + '%')
The result is that I get an error message like this (I'm sorry but I
translate the message to english, so it probably it doesn't appear exactly
as is):
"No needed value specified for some parameters". I also tried this:
SELECT * FROM tblPatients WHERE (Nome LIKE [@WriteNome] + '*'), getting the
same result. If I remove the square brackets I get an SQL syntax error. I
understand that I must pass a parameter to my query, but I can't understand
how; I think it's an Access issue, but at this point I'm not really sure
about nothing.

Thanks for your patience.
Max

>
> Please give us more specifics.
>
> Robin S.
> ---------------------------------------------------------------
>
> "max" <max@max.max> wrote in message
> news:12pvh.29343$bH4.16252@tornado.fastwebnet.it...
>>
>> I repost this, with the actual column names:
>> I have an Access2003 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 tblPatients WHERE nome LIKE nome + '*' (I'm not really sure
>> it's the
>> right syntax for querying an access db).
>> Closing the form, it adds a search button and a FillByNomeToolStrip
>> 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
>> FillByNome(dataTable As demoDataSet.tblPatientsDataTable) As Integer"
>>
>> Here is the autogenerated vb code about the fill statement:
>>
>> Private Sub FillByNomeToolStripButton_Click(ByVal sender As
>> System.Object, ByVal e As System.EventArgs) Handles
>> FillByNomeToolStripButton.Click
>> Try
>> Me.tblPatientsAdapter.FillByNome(Me.demoDataSet.tblPatients,
>> NomeToolStripTextBox.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.
>>
>>
>> "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> ha scritto nel
>> messaggio news:9d3sr2lh5193a3503ie1cibrsum3a56m7g@4ax.com...
>>> On Thu, 25 Jan 2007 17:15:13 +0100, "max" <max@max.max> wrote:
>>>
>>> ¤
>>> ¤ Name is just 'something'. In my vb code it's 'Nome'.
>>> ¤
>>>
>>> Unless you post the exact statement, including the actual column names
>>> you are using, it will be
>>> very difficult to troubleshoot the problem.
>>>
>>>
>>> Paul
>>> ~~~~
>>> Microsoft MVP (Visual Basic)
>>>
>>
>>
>>
>
>
>




Re: Queries to an Access db from vs2005 by max

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,
>