|
-
Nov 19th, 2000, 10:51 AM
#1
whats wrong with this sql ::
select * from DTDC_Service_Offices where city like 'A*' order by city, branchname
in MS Access its resulting in 30 records but when fired from VB its returning 0 records, is there any problem with the * sign or what is it ? can't figure it out.
thanx
-
Nov 19th, 2000, 11:05 AM
#2
Lively Member
Your code, as entered here, is correct. It will return records as requested. If you are returning 0 records, you might check to ensure that there is not an imbedded space before the "A". It's either something like that or you have no cities beginning with "A" :-).
-
Nov 19th, 2000, 11:44 AM
#3
i have cities beginning with A, but this query is not working with VB....... can't figure it out still !!
-
Nov 19th, 2000, 11:48 AM
#4
Lively Member
Kan -
Just to make sure I haven't completely lost it, I took one of our tables with plenty of records and ran your sql against it; it came out just fine. Then, I created the same sql, but "accidentally" threw in a space after the apostr (' A*'). I got 0 records returned. I tried a number of other times, using other spurious chars. Each one gave me 0 records.
Try using a copy-paste to put your code here (don't type it). Let's see if there IS a spurious char.
-
Nov 19th, 2000, 12:03 PM
#5
i tried copy pasting it ........ still giving 0 records
and there's no space before A
-
Nov 19th, 2000, 12:27 PM
#6
Lively Member
Paste it here using the tags
-
Nov 19th, 2000, 12:48 PM
#7
code-----
i've a variable mysql which contains
mysql="select * from DTDC_Service_Offices where city like 'A*' order by city, branchname"
Set rsDtdc = rc.OpenResultset(mysql, rdOpenKeyset, rdConcurRowVer)
and its returning 0 records
-
Nov 19th, 2000, 09:33 PM
#8
Lively Member
Kan-
Can you show me how you set your environment and connection? Additionally, why use RDO for an Access database? DAO is so much simpler and less prone to error.
-
Nov 20th, 2000, 03:11 AM
#9
Public re As rdoEnvironment
Public rc As rdoConnection
rdoEngine.rdoDefaultCursorDriver = rdUseClientBatch
Set re = rdoEngine.rdoEnvironments(0)
re.CursorDriver = rdUseOdbc
Set rc = re.OpenConnection("courier", Connect:="uid=; pwd=sandy")
there's an odbc set named 'courier' for the databade
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
|