-
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
-
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" :-).
-
i have cities beginning with A, but this query is not working with VB....... can't figure it out still !!
-
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.
-
i tried copy pasting it ........ still giving 0 records
and there's no space before A
-
Paste it here using the tags
-
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
-
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.
-
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