473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

May anyone explain me how to use DBGrid in VB6.0 ?

Now I have to use DBGrid to edit and retrieve from the database.
So how can I do that in VB6.0?.So kindly reply me anyone quickly.
Feb 23 '07 #1
9 11590
vijaydiwakar
579 512MB
Now I have to use DBGrid to edit and retrieve from the database.
So how can I do that in VB6.0?.So kindly reply me anyone quickly.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. rs0.opend "select * from table ", Conn
  4. db.DataSource = rs0
  5. End Sub
  6.  
  7.  
in this way u can retrive the data
Feb 23 '07 #2
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. rs0.opend "select * from table ", Conn
  4. db.DataSource = rs0
  5. End Sub
  6.  
  7.  
in this way u can retrive the data
I couldn't access with that code. So I want the codings with some more details.
Feb 23 '07 #3
vijaydiwakar
579 512MB
I couldn't access with that code. So I want the codings with some more details.
explain me thy reqd in detail
Feb 23 '07 #4
explain me thy reqd in detail
I want to retrieve the database fields in DBGrid .
My database table is table1,The fields are empid,dat....
For that kidly send me the codings to show/edit the databse contents in DBGrid1.
Feb 23 '07 #5
vijaydiwakar
579 512MB
I want to retrieve the database fields in DBGrid .
My database table is table1,The fields are empid,dat....
For that kidly send me the codings to show/edit the databse contents in DBGrid1.
Expand|Select|Wrap|Line Numbers
  1.  
  2. dim Rs0 as new Adodb.Recordset
  3. dim Conn as new Adodb.Connection
  4. Conn.open " Connection String"
  5. ssql="select * from table1"
  6. rs0.open ssql,Conn
  7. with grd
  8.  
  9. do while rs0.eof=false
  10. .rows=.rows+1
  11. .textmatrix(.rows,1)=rs0("fiildname") &""
  12. .textmatrix(.rows,2)=rs0("fiildname") &""
  13. rs0.movenext
  14. loop
  15. rs0.close:set rs0=nothing
  16. end with
  17.  
in this way u can retrive d data
Feb 23 '07 #6
Expand|Select|Wrap|Line Numbers
  1.  
  2. dim Rs0 as new Adodb.Recordset
  3. dim Conn as new Adodb.Connection
  4. Conn.open " Connection String"
  5. ssql="select * from table1"
  6. rs0.open ssql,Conn
  7. with grd
  8.  
  9. do while rs0.eof=false
  10. .rows=.rows+1
  11. .textmatrix(.rows,1)=rs0("fiildname") &""
  12. .textmatrix(.rows,2)=rs0("fiildname") &""
  13. rs0.movenext
  14. loop
  15. rs0.close:set rs0=nothing
  16. end with
  17.  
in this way u can retrive d data

I tried with that code.But the error occured as "Object required"
Feb 23 '07 #7
vijaydiwakar
579 512MB
I tried with that code.But the error occured as "Object required"
for that first of all add control of grid and rename it to the name of grid which ihave given in 'with' code
Feb 23 '07 #8
for that first of all add control of grid and rename it to the name of grid which ihave given in 'with' code
Can you explain me the following code from you have given
Expand|Select|Wrap|Line Numbers
  1. .rows=.rows+1
  2. .textmatrix(.rows,1)=rs0("fiildname") &""
  3. .textmatrix(.rows,2)=rs0("fiildname") &""
Feb 23 '07 #9
vijaydiwakar
579 512MB
Can you explain me the following code from you have given
Expand|Select|Wrap|Line Numbers
  1. .rows=.rows+1
  2. .textmatrix(.rows,1)=rs0("fiildname") &""
  3. .textmatrix(.rows,2)=rs0("fiildname") &""
line 1 increments grid row by one
2 assigns recordset's field data to perticular cell with last newest row and 1,2 column
Feb 23 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ranyart Olias | last post by:
Can anyone explain why the <root@hiddenworld.net> portion of this html doesn't render in a browser, but the <20031010152346.GA15353@server.hiddenworld.net> portion does? Here is the html...
2
by: John D | last post by:
can anyone explain why a site would use this in their page <!--<BR>--> Presumably it is hiding the <BR> from ... ??? TIA John
4
by: Chris | last post by:
Hello Could anyone explain why the following: #footer ul { float : left; margin : 2px 0px 7px 28px; padding : 0px; width : 360px;
13
by: C++fan | last post by:
The following code is for list operation. But I can not understand. Could anyone explain the code for me? /* * List definitions. */ #define LIST_HEAD(name, type) struct name { type...
1
by: Andrew | last post by:
Hello, friends, I am implementing web app security using asp.net 1.1, and I found the following source code from Yahoo! Mail login page: <form method="post"...
1
by: Jia Lu | last post by:
Hello I have a program that can telnet to a host. But I cannot understand from part, can anyone explain it to me? Thank you very much. import sys, posix, time
3
by: Bhuwan Bhaskar | last post by:
Hi, Can anyone explain when to use state server or Sql server to save sessions. Thanks, Bhuwan
1
Eclipse
by: Eclipse | last post by:
G'day all Can anyone explain the difference in the results to me as I don't understand why specifying the directory name in two different ways could give a different answer. In CODE 1 below i...
4
by: Eddie Rivera | last post by:
I am trying to add a search box on a form in Access to link to other tables. Can anyone explain how this is done? Thanks for your help in advance!
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.