|
-
Jul 18th, 2000, 05:48 AM
#1
Thread Starter
Addicted Member
i just got a different error msg. it said Syntax error in FROM clause and then i got the runtime error as before.
my code this time is
Dim search As String
Dim band As String
band = Trim(txtband.Text)
search = "select cd_serial_numbers.band_name, cd_serial_numbers.album_name, cd_serial_numbers.genre, cd_serial_numbers.single/album, cd_serial_numbers.released, cd_serial_numbers.company, cd_serial_numbers.serial from cd_serial_numbers"
If Len(band) Then
If blnFirstWhere Then
blnFirstWhere = False
search = search & " WHERE "
Else
search = search & " OR "
End If
End If
search = search & " (band_name = '" & band & "')"
Debug.Print search
Adodc1.RecordSource = search
Adodc1.Refresh
When the runtime error comes up and i go debug it highlights the last line of code
adodc1.refresh i thinking i might have to use a set or let command before this line but i'm not sure.
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 18th, 2000, 05:53 AM
#2
Fanatic Member
I can't see in your sql where there is a FROM.
Thats most likely your problem.
-
Jul 18th, 2000, 05:57 AM
#3
Thread Starter
Addicted Member
its there but this time in capitals
search = "SELECT cd_serial_numbers.band_name, cd_serial_numbers.album_name, cd_serial_numbers.genre, cd_serial_numbers.single/album, cd_serial_numbers.released, cd_serial_numbers.company, cd_serial_numbers.serial FROM cd_serial_numbers"
Now can you see the Select and the FROM?
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 18th, 2000, 06:00 AM
#4
Fanatic Member
Doh!
Sorry about that, I scanned through it quickly and missed the from.
-
Jul 18th, 2000, 06:07 AM
#5
Fanatic Member
You can have your SQL like this, it won't help you, but will give your fingers a rest. 
Code:
search = "SELECT band_name, album_name, genre, single/album, released, company, serial FROM cd_serial_numbers"
A syntax error in FROM clause is usually just a spelling mistake in your SQL.
What does the Debug.Print Search display when run?
-
Jul 18th, 2000, 06:07 AM
#6
Thread Starter
Addicted Member
thats alright its a bit hard to see.
anyway, the sql works it just not refreshing it properly.
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|