Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
flexgrid..pls help
View previous topic :: View next topic  
Author Message
azrina
Newbie


Joined: 22 Jan 2004
Posts: 3

PostPosted: Jan 22nd, 2004 02:57 PM    Post subject: flexgrid..pls help Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Jan 22nd, 2004 11:49 PM    Post subject: Reply with quote

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
View user's profile Send private message
azrina
Newbie


Joined: 22 Jan 2004
Posts: 3

PostPosted: Jan 23rd, 2004 03:41 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Jan 24th, 2004 05:57 AM    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic