Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

Can anyone help me (for God's sake)?

cobek
Beginner
756 Views
Hi all,
i have already posted similar question but i did not get any answer. I have spent whole week trying to find a solution, obviously, not successfuly :-)
I am trying to use ADO Data and DataGrid ActiveX controls and I have following problem:
when I insert controls (on a dialog), set all properties (among them, DataSource property of the DataGrid control reffers to ADO Data identifier) to and try to test a connection with database (through the underlying database provider) in Resources window i get what i want. But when i compile the project the ADO Data control is enabled and DataGrid control is not populated with data. I can get some basic properties (Title, etc) but if i want to set DataSource during run-time i get an error (the code of the error is unknown to Error Lookup tool).

i used following code

-to get idispatch interfaces:

lret=DlgGet(gdlg,DBDLG_ADODC,ado,DLG_IDISPATCH)
lret=DlgGet(gdlg,DBDLG_DATAGRID,dgrid,DLG_IDISPATCH)

-to get recordset

rs=IAdodc_GetRecordset(ado,ret)

-and then to set DataSource prperty

one of the first tries was using rs:
rs=IAdodc_GetRecordset(ado,ret) - this fails!!!
call IDataGrid_SetDataSource(dgrid,rs,ret)

one among others million tries was (using ADO 2.6 Type library - Connection, Recordset objects):

call $Connection_SetConnectionString(conn,'DSN=GOVNO',ret) !;-)
call $Connection_Open(conn,$STATUS=ret)
rs=$Connection_Execute(conn,"SELECT MyTable.* FROM MyTable;",$STATUS=ret)
ds=$Recordset_GetDataSource(rs,ret)
call IDataGrid_SetDataSource(dgrid,ds,ret) !fails again

Does anyone know what should be second parameter for
call IDataGrid_SetDataSource ?

Thanks






call IDataGrid_SetDataSource(dgrid,temp,ret)
Has anyoune used DataGrid co
0 Kudos
4 Replies
cobek
Beginner
756 Views
sorry i made mistake:

what fails in first try is

call IDataGrid_SetDataSource(dgrid,rs,ret)
0 Kudos
Jugoslav_Dujic
Valued Contributor II
756 Views
Well, I tried some googling but nothing relevant came apart... if you don't consider the following quote relevant :-(

Hi Peter,
I have been following all the postings relating to grid. I was also trying to display records from a sql server table in a grid format. But I found this whole thing very difficult and finally gave up. Looks like no body has really used these grids or if someone knows, he/she doesn't want to tell anybody. This is really frustrating. I haven't seen much documentation/tutorial also on grids. I just wanted to share my thoughts with you.

Good Luck.
Sugriv


In any case, you're unlikely to find an answer here, since no one seems to have worked with IDataGrids. I'd suggest some microsoft.public. newsgroup (although judging on these Google results, you shouldn't be too enthusiastic about it either).

I know that it doesn't help...

Jugoslav
0 Kudos
Jugoslav_Dujic
Valued Contributor II
756 Views
...btw, have you checked out this link found using Google?

Disclaimer: As you may have already concluded, it's Greek to me.
0 Kudos
cobek
Beginner
756 Views
Thanks Jugoslav, anyway
0 Kudos
Reply