Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to use DataGrid but doing something wrong with adodc
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Trying to use DataGrid but doing something wrong with adodc
Miscellaneous
Thread ID:
00506334
Message ID:
00506334
Views:
84
hi all -

i am new to using a data grid and i am not sure if i am putting together all the right pieces. i'm using vb6 and msaccess97. on a form, i added a datagrid (component datagrid control 6.4 (sp4) (oledb)) and an ado data control 6.0 (sp4)(oledb)). i have a recordset that i get by getting a connection string, opening the connection, setting the recordset to the active connection, and opening the recordset with an sql. the code is always changing so i have not stored anything in the controls themselves except for the connection string in the adodc. below is psuedo code for my recordset.

i created a dsn that i am using for the connection string.
Dim oConn As New ADODB.Connection
Dim rsObj As ADODB.Recordset
Dim strConnection As String

strConnection = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dev; password=dev"

oConn.Open strConnection
rsObj.ActiveConnection = oConn
rsObj.Open strQuery, , adOpenDynamic, adLockPessimistic
in the datagrid i specify the datasource as the adodc object that is on my form.

in the load of my form i set the record source on the adodc and refresh it.
adodc.RecordSource = strQActivity
adodc.Refresh
but i keep getting errors. i'm sure i'm doing this wrong with not specifying all the necessary properties or something else but i'm new to this and i was hoping for some input from anyone out there. one of the errors is stating "[adodc]: no record source specified. [ado]: command text was not set for the command object but i wasn't using a command object. just the connection object and recordset object. any thoughts would be much appreciated.

tia

piper
Next
Reply
Map
View

Click here to load this message in the networking platform