SQL From VB

barrios1

New member
Local time
Today, 01:52
Joined
Jan 21, 2003
Messages
7
I hope this is appropriate for this forum!
I am designing a mailing database and am using this query to pick up possible duplicates in addresses.

I have a query I need to run from a VB application.

The VB code looks like this

s = "INSERT INTO DupPar ( Addr1, ID, FName, LName, Addr2,Addr3, Addr4, Addr5, Notes, Telh, Email, VI, TelW, TelM )"


s = s & " SELECT Parents.Addr1, Parents.ID, Parents.FName, Parents.LName, Parents.Addr2, Parents.Addr3, Parents.Addr4, Parents.Addr5, Parents.Notes, Parents.Telh, Parents.Email, Parents.VI, Parents.TelW, Parents.TelM, * From Parents"





s = s & " WHERE (((Parents.Addr1) Like '*" & Ad1 & "*'));"
Debug.Print s
c.Execute (s)

When I 'debug.print' the resulting string and paste it into a query in Access it works fine, however it will not work directly from VB.
I don't get any error, the query just does not pick up any records when it's run from VB. My suspicion is that the * symbol is the culprit but I have no idea what the solution is.

Many thanks in advance to whoever tries to help me!!!!
 
Try % instead of *
 

Users who are viewing this thread

Back
Top Bottom