ADO problems with VB.NET 2003

R

Rubber Steve

I am having trouble querying an Access database with ADO .NET in VB .NET. I
can get results returned using primary keys, but when using something like
LastName, nothing happens. I am not sure why this is. Here is the query
that works, and the one that doesn't:

Works:
cmd = New OleDbCommand("select * from employee where EmployeeID= " &
txtEmployeeID.Text, cn)

Does Not Work:
cmd = New OleDbCommand("select * from employee where EmpLastName like " &
txtLast.Text, cn)

Any help would be greatly appreciated,

Rubber Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top