Click to See Complete Forum and Search --> : What could be wrong in this code ???
maqmaq
Sep 20th, 2000, 01:03 AM
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]
Edneeis
Sep 20th, 2000, 01:16 AM
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:
Set DBGrid1.DataSource = rs
maqmaq
Sep 20th, 2000, 02:04 AM
!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
Try to put your code on "Private Sub Form_Active()
not the Load.
( and let us know what happens :<) )
Feras
Sep 20th, 2000, 09:11 PM
I think you just need to refresh your data before you assigne it to the dbgrid:
crdatabase.Refresh
maqmaq
Sep 26th, 2000, 03:52 AM
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
Feras
Oct 6th, 2000, 02:23 AM
maqmaq, if you are using vb6 thin you just have to install service package 4 (SP4) which can be found at microsoft site.
maqmaq
Oct 7th, 2000, 03:15 AM
Thank you Feras
I downloaded the latest SPA, at http://msdn.microsoft.com/vstudio/sp/vs6sp4/default.asp
Thank you
maqmaq
KSA
maqmaq
Oct 7th, 2000, 04:10 AM
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/kb/articles/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]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.