| View previous topic :: View next topic |
| Author |
Message |
azrina Newbie
Joined: 22 Jan 2004 Posts: 3
|
Posted: Jan 22nd, 2004 02:57 PM Post subject: flexgrid..pls help |
|
|
how to save keypressed data entry in the flexgrid cell to the database(ms access)?is this operation possible??i dont have idea how the data could be saved??pls help.
just for info, the columns are fixed and the rows depend on the variable..i enclose the screen of my flexgrid fill with data..
tq in advance.. |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Jan 22nd, 2004 11:49 PM Post subject: |
|
|
An easy way to do this by creating a data object on the form. It's one of the default controls. You would set this up to connect to the database and link the flexgrid to it using the datasource property. Give it a shot and see how far you get with it. I'll monitor the thread in case you get lost. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
azrina Newbie
Joined: 22 Jan 2004 Posts: 3
|
Posted: Jan 23rd, 2004 03:41 AM Post subject: |
|
|
for ur info..i am new in this vb programming and im using ADO..
someone suggested me to fill with recordset and use INSERT..the prob is, i donno how, i am familiar with SELECT statement but not INSERT statement..
do u have any sample code that i can learn and apply it to my flexgrid problem..
tq in advance |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Jan 24th, 2004 05:57 AM Post subject: |
|
|
One way to do it with ADO is to call a recordset and bind it to a Datagrid (Project | Components | Microsoft DataGrid Control). This control you can bind right to the Recordset and interact with the data. I had this in my head when you said Flexgrid. If you use the flexgrid, you have to do everything manually as you said earlier, it involves stepping through the Columns and Rows of data and building the flexgrid up. This way is much easier.
You can actually bind the DataGrid to the recordset object. Here is an example...
| Code: |
Private DB As ADODB.Connection
Private RS As ADODB.Recordset
Private Sub Form_Load()
Set DB = New ADODB.Connection
Set RS = New ADODB.Recordset
DB.Open "DSN=TEST"
RS.Open "Client", DB, adOpenStatic, adLockOptimistic, adCmdTable
Set DataGrid1.DataSource = RS
DataGrid1.AllowAddNew = True
DataGrid1.AllowDelete = True
End Sub
|
In case your looking for a reference to the SQL language: Here is Microsoft's reference _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Last edited by Andir on Jan 24th, 2004 06:04 AM; edited 1 time in total |
|
| Back to top |
|
|