borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (select  distinct)Next Topic (SQL Expert required) New Topic New Poll Post Reply
AndreaVB Forum : Database : sql problem
Poster Message
Dr1sk4n
Level: Guest


icon sql problem

What am i doing wrong?
'baza = database
'naziv = title
'vsiartikli = table
'pregledtabela = MSFlexGrid

Private Sub Command1_Click()

baza.RecordSource = "SELECT naziv FROM [vsiartikli] where [naziv] like text1.text "
pregledTabela.Refresh
baza.Refresh

End Sub

05-01-2003 at 01:05 PM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: sql problem

hi! welcome to the forum!

it would also help if you had the subject of your post like
"sql syntax problem"

try changing your  sql statement into this:

baza.RecordSource = "SELECT naziv FROM [vsiartikli] where [naziv] like '" & text1.text & "' "


when you are using indirect values like --text1.text--, you have to exclude them from the quotes, and you also have to add the --'-- before and after, like that in the code.

hope this helps.
  

[Edited by vbgen on 05-01-2003 at 11:34 PM GMT]

____________________________
Been busy trying to take a second degree <--it's not working out...

05-01-2003 at 03:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : sql problem
Previous Topic (select  distinct)Next Topic (SQL Expert required) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder