FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
access, vb.net
HighTechTalks DotNet Forums
Microsoft DotNet Framework
Dotnet Framework (ODBC.net)
access, vb.net
Dotnet Framework (ODBC.net)
microsoft.public.dotnet.framework.odbcnet
Discuss
access, vb.net
in the
Dotnet Framework (ODBC.net)
forum.
Thread Tools
Search this Thread
Display Modes
#
1
joanne via .NET 247
Posts: n/a
access, vb.net -
03-15-2005 , 03:45 PM
What is the code in vb.net to run query stored in access (and display the result in a datagrid)?
--------------------------------
From: joanne
-----------------------
Posted by a user from .NET 247 (
http://www.dotnet247.com/
)
<Id>dcf6iYNPo0ubp9ePrld2Ag==</Id>
joanne via .NET 247
#
2
Paul Clement
Posts: n/a
Re: access, vb.net -
03-16-2005 , 10:40 AM
On Tue, 15 Mar 2005 12:45:05 -0800, joanne via .NET 247 <anonymous (AT) dotnet247 (DOT) com> wrote:
¤ What is the code in vb.net to run query stored in access (and display the result in a datagrid)?
¤
Dim AccessConn As System.Data.OleDb.OleDbConnection
AccessConn = New System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\db1.mdb")
AccessConn.Open()
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("qryTable1", AccessConn)
AccessCommand.CommandType = CommandType.StoredProcedure
Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
With da
.SelectCommand = AccessCommand
End With
Dim ds As New DataSet("QueryTables")
da.Fill(ds, "Table1")
DataGrid1.SetDataBinding(ds, "Table1")
AccessConn.Close()
Paul
~~~~
Microsoft MVP (Visual Basic)
Paul Clement
«
Previous Thread
|
Next Thread
»
Thread Tools
Search this Thread
Show Printable Version
Email this Page
Search this Thread
:
Advanced Search
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Contact Us
-
HighTechTalks DotNet Forums
-
Archive
-
Top