Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 28-08-2008, 11:25 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Dec 2006
Posts: 32
Default VB 6 Help Needed


I am using VB6 with Access for a data entry project.

i have an idea to use MSflexgrid to display the data whenever i save it in the database.

i mean i have a form with four fields and adding and updating the new datas to the database.

i need to display the data automatically in the flexgrid whenever i am clicking the save button.

also the existing datas in the database should appear in the ms flexgrid tool.

please tell me the code to display the records in msflexgrid automatically when i save it to the database.
part_time_ch is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 30-08-2008, 05:17 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2008
Posts: 2
Default Re: VB 6 Help Needed

it is not bind data with msflexgrid , so you have to rebind data again.
priyank80 is offline  
Old 31-08-2008, 04:49 PM   #3 (permalink)
javed4shab
Guest
 
Posts: n/a
Thumbs up Re: VB 6 Help Needed

Boss,

You should use a component named :
"Microsoft ADO Data Control 6.0"
This control works best for Data Grid Flex.
1. DRAW ADO CONTROL.
2. RIGHT CLICK on ADO CONTROL.
3. Set Properties.
4. Now Click on Data Grid set it's Datasource property to "adodc1".
5. The Problem will be solved.

If you wish to connect through ADO Code then use :

down load reference " Microsoft Activex Dataobjects 2.0 Library"
Now type following code:

Dim con as new adodb.connection
dim rs as new adodb.recordset
Private sub form_load()
set con = new adodb.connection
with con
.connectionstring = "provider= Microsoft jet 2.0; filename= " 'enter file name
.connectiontimeout = 5
.cursor location = aduseclient
.open
end with
end sub
private sub cmdsave_click() 'cmdsave is name of save command button
rs.open "select * from emp", con, adopendynamic, lockoptimistic, adcmdtext
rs!empno = text1.text 'empno is database field
rs!absg = text2.text
rs.update
set datagrid1.datasource = rs.datasource ' where rs is recordset that you've create.
'and datagrid1 i name of data grid.
end sub
This will Solve your Problem. Enjoy


JAVED KHAN
IT EXECUTIVE
javed4shab@gmail.com
 
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed. Things needed to connect SATA HDD to... prashantmaxsteel Hardware Q&A 3 21-11-2007 12:26 PM
needed 2 buy a good camera????? help needed.. The Day Walker! Cameras and camcorders 5 02-07-2005 04:43 PM
help needed krishnansurya QnA (read only) 2 26-01-2005 07:40 PM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 11:11 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2