|
-
Oct 20th, 2001, 11:39 AM
#1
Thread Starter
PowerPoster
Soring records
I am trying to sort the records in table by using SQL statement or the "recordset.sort" property of data control.
For SQL:
VB Code:
Data1.RecordSource = "Select * from Customers order by CompanyName Asc"
It gives me an error message saying "jet databse engine could not find the object 'select *...'
For data control:
VB Code:
Data1.RecordSet.Sort = "ComapnyName"
Is that how you sort the records or there is some other way to do it?
-
Oct 20th, 2001, 11:53 AM
#2
Member
why don't you try getting the SQL query into a recordset and then setting the source to the recordset? I think it's problem is that the query is not an actual thing that it can link it to.
-
Oct 20th, 2001, 12:05 PM
#3
Thread Starter
PowerPoster
-
Oct 20th, 2001, 12:13 PM
#4
Member
I'm not sure about the exact code (I still have to look up most things!) but it's something like this:
VB Code:
Dim rs as new Recordset
rs = "Select * from Customers order by CompanyName Asc"
data1.recordsource = rs
again I'm not sure about the exact code
-
Oct 20th, 2001, 12:16 PM
#5
Thread Starter
PowerPoster
I does not work
-
Oct 20th, 2001, 12:16 PM
#6
Member
-
Oct 20th, 2001, 12:17 PM
#7
Thread Starter
PowerPoster
"Invalid use of property" error on line:
rs = "Select * from Customers order by CompanyName Asc"
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
|