Re: Having problem with this query
From: Norman Yuan (normanyuan_at_RemoveThis.shaw.ca)
Date: 03/26/04
- Next message: Jeff Johnson [MVP: VB]: "Re: unable to print line in vb"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Having problem with this query"
- In reply to: Faraz Azhar: "Having problem with this query"
- Next in thread: Faraz Azhar: "Re: Having problem with this query"
- Reply: Faraz Azhar: "Re: Having problem with this query"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 22:21:28 GMT
Are you using ADO? try to use % as wildcard, instead of *, also, use '
around text value, instead of ". That is
SQL = "SELECT * FROM [Employee Information] WHERE [Name] Like 'nav%'"
I'd use [] around field name "Name", to be safe.
"Faraz Azhar" <itz_faraz@hotmail.com> wrote in message
news:7808b5d7.0403261352.1790849@posting.google.com...
> Hello,
>
> I have a few records in an Access database. There is a field called
> "Name" in a table called "Employee Information"
>
> I have this query:
> SELECT * FROM [Employee Information] WHERE Name Like "nav*"
>
> If i use this query in Access, it works ok. It returns the complete
> details (all fields) of an employee called Naveed Ashraf. But when im
> using this in VB its not working. Im using this:
>
> SQL = "SELECT * FROM [Employee Information] WHERE Name Like ""nav*"""
> RS.Open SQL, Conn, adOpenStatic, adLockOptimistic
>
> The recordset that returns is empty, it doesnt have any records in it.
> Whats wrong with this query? why isnt recordset being populated?
>
> My code is A-OK, everything is working. Normal queries are working (
> by normal i mean : RS.Open "SELECT * FROM [Employee Information]", 3,
> 3) are working.
>
> Can anyone help?
>
> - Faraz Azhar
- Next message: Jeff Johnson [MVP: VB]: "Re: unable to print line in vb"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Having problem with this query"
- In reply to: Faraz Azhar: "Having problem with this query"
- Next in thread: Faraz Azhar: "Re: Having problem with this query"
- Reply: Faraz Azhar: "Re: Having problem with this query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|