|
-
Sep 20th, 2000, 01:03 AM
#1
Thread Starter
Addicted Member
What could be the problem in this code ???
I assign the data source of a dbgrid to the recordset as follow:
Private Sub Form_Load()
On Error Resume Next
Dim rs As Recordset
Dim crdatabase as Database
sPath = "c:\db\cr.mdb"
Set crdatabase = OpenDatabase(sPath)
Set rs = crdatabase.OpenRecordset("cr")
DBGrid1.DataSource = rs
'add the field names in the list
For Each fl In rs.Fields
List1.AddItem fl.Name
Next
End Sub
The problem is the dbgrid does not load any thing but the list works fine and all fields name are added...
What could be the problem of that,,Any help..Thanks
[Edited by maqmaq on 09-20-2000 at 02:05 AM]
-
Sep 20th, 2000, 01:16 AM
#2
Are you using the OLEDB DataGrid?
Have you tried connecting to it at design time?
Are you getting an error?
Please give more info. Also it should be:
Code:
Set DBGrid1.DataSource = rs
-
Sep 20th, 2000, 02:04 AM
#3
Thread Starter
Addicted Member
!I am using the Data Bound Grid Control 5 (SP3)
!I am trying to connect at run time via the load of the form
!The error I got when I remove the On Error Resume Next
is: Class doesn't support Automation (Error 430)
!I tried the code you mentioned and still the same problem and error
-
Sep 20th, 2000, 06:29 AM
#4
Try to put your code on "Private Sub Form_Active()
not the Load.
( and let us know what happens :<) )
-
Sep 20th, 2000, 09:11 PM
#5
Lively Member
I think you just need to refresh your data before you assigne it to the dbgrid:
crdatabase.Refresh
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Sep 26th, 2000, 03:52 AM
#6
Thread Starter
Addicted Member
Thank you all for the participance!
The only way to fix this was to save the Access2000 data base as previous version and it was OK
Thank you again
-
Oct 6th, 2000, 02:23 AM
#7
Lively Member
solution
maqmaq, if you are using vb6 thin you just have to install service package 4 (SP4) which can be found at microsoft site.
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 03:15 AM
#8
Thread Starter
Addicted Member
Thank you Feras
I downloaded the latest SPA, at http://msdn.microsoft.com/vstudio/sp/vs6sp4/default.asp
Thank you
maqmaq
KSA
-
Oct 7th, 2000, 04:10 AM
#9
Thread Starter
Addicted Member
Feras
When SPA4 installed, whenever I select new enterprise edition control project, the following error occured:
System error.....No such interface supported..
What could be the problem
Thanks
,,,,,
Feras
I got the answer for the above problem in here:
http://support.microsoft.com/support.../Q183/3/70.ASP
I did not like to delete this message to keep it as a reference in future
Thanks again
[Edited by maqmaq on 10-07-2000 at 05:41 AM]
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
|