Hi,
There is an error on DataGrid1.DataSource = Adodc1.RecordSource method or data member not found. When i do below setting manuel in properties, there is no problem.

Thanks

Adodc1.ConnectionString = "Provider=MSDAORA.1;Password=psw;User ID=iuu;Data Source=video;Persist Security Info=True"
Adodc1.RecordSource = "Select * From movie"
DataGrid1.DataSource = Adodc1.RecordSource

Dani AI

Generated

As showed, the code attempted to assign the ADODC control's SQL text to the grid. The SQL string (the RecordSource) is not an ADO Recordset object, and in VB6 any object assignment requires the Set keyword. was right to mention Set, but the DataGrid must be bound to an object (the ADODC control or its Recordset), not the SQL string.

A simple, correct pattern is to make sure the ADODC has an open recordset and then bind the DataGrid to the control or to the recordset:

' after the ADODC has been prepared/opened
Set DataGrid1.DataSource = Adodc1
' or bind the actual recordset object
Set DataGrid1.DataSource = Adodc1.Recordset

Troubleshooting notes: verify Adodc1.Recordset is not Nothing before binding (call the ADODC's Refresh if needed), and use a client-side cursor type when the grid needs to navigate the set. On modern systems the Microsoft Oracle provider used in old examples may be missing or unsupported on 64-bit Windows; if that is relevant, switch to Oracle's OLE DB provider or an appropriate ODBC driver. Thanks to for the Set hint and to for confirming the approach works.

Recommended Answers

All 2 Replies

you need to use

set DataGrid1.DataSource = Adodc1.RecordSource

Thanks! This helped me out a lot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.