| | |
need code to display a database in access using Datagrid
Thread Solved |
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
hi,
i want to display one table in a access database using datagrid.
i tried to do like this.
con.open constring
set rs=con.execute("command to select the table")
set datagrid.DataSource=rs
but it shows an runtime error like this:
RunTime Error '7004'
The rowset in not bookmarkable
wats' the reason... pls post simlified answers.
coz i'm a beginer.
i want to display one table in a access database using datagrid.
i tried to do like this.
con.open constring
set rs=con.execute("command to select the table")
set datagrid.DataSource=rs
but it shows an runtime error like this:
RunTime Error '7004'
The rowset in not bookmarkable
wats' the reason... pls post simlified answers.
coz i'm a beginer.
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
yes bro!
here's the complete code.
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
con.open dbConStr
rs.open "select * from <tablename>", con, adOpenDynamic, adLockOptimistic
set DataGrid.DataSource=rs
here's the error no
RunTime Error '7004'
The rowset in not bookmarkable
please help me.
here's the complete code.
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
con.open dbConStr
rs.open "select * from <tablename>", con, adOpenDynamic, adLockOptimistic
set DataGrid.DataSource=rs
here's the error no
RunTime Error '7004'
The rowset in not bookmarkable
please help me.
Last edited by rahmathmail; Dec 31st, 2008 at 2:23 am.
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Solved Threads: 1
'your code
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
con.open dbConStr
rs.open "select * from <tablename>", con, adOpenDynamic, adLockOptimistic
set DataGrid.DataSource=rs
'=======================
'modified version of your code
'=======================
'variable declaration
Private strSQL as string
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
strSQL = " select * from <tablename>"
'open database connection
con.open dbConStr
set rs = new Adodb.Recordset
rs.CursorLocation = AdUseClient
'only if you want to view records on datagrid
rs.open strSQL, con, AdOpenForwardonly, AdlockReadonly
'always check if there is a record
if rs.recordcount = 0 then exit sub
if rs.recordcount > 0 then
DataGrid.DataSource = rs
end if
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
con.open dbConStr
rs.open "select * from <tablename>", con, adOpenDynamic, adLockOptimistic
set DataGrid.DataSource=rs
'=======================
'modified version of your code
'=======================
'variable declaration
Private strSQL as string
dbConStr = Connection String
DataGrid = Name of MS DataGrid Control 6.0
strSQL = " select * from <tablename>"
'open database connection
con.open dbConStr
set rs = new Adodb.Recordset
rs.CursorLocation = AdUseClient
'only if you want to view records on datagrid
rs.open strSQL, con, AdOpenForwardonly, AdlockReadonly
'always check if there is a record
if rs.recordcount = 0 then exit sub
if rs.recordcount > 0 then
DataGrid.DataSource = rs
end if
![]() |
Similar Threads
- Search Access Records (VB.NET)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Need help with ms access and vb.net (VB.NET)
- Please help me :"login form use drag and drop toolbox" ! (C#)
- How can i retrieve data after i logod on..... (ASP.NET)
- Finding records in access using a vb button (Visual Basic 4 / 5 / 6)
- ASP.NET Tutorial: Caching in ASP.NET (ASP.NET)
- database question (C#)
- Help with ADMIN side of login ASP.NET (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: moving position of underline
- Next Thread: Using VB Calendar
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





