Batch commands & Ms-Access

  • Thread starter Thread starter Selva Chinnasamy
  • Start date Start date
S

Selva Chinnasamy

Hi I am using batch commands against Ms-Access and getting an error
Message "Characters found after end of SQL statement." String

Here is my sql Dim str_screens As String = "Select * from Screens Order by
ScreenName;Select * from Functions"

How can I fix this problem. Any help is greatly appreciated.

Selva
 
Selva Chinnasamy said:
Hi I am using batch commands against Ms-Access and getting an error
Message "Characters found after end of SQL statement." String

Here is my sql Dim str_screens As String = "Select * from Screens
Order by ScreenName;Select * from Functions"

How can I fix this problem.

Remove the characters after the end of SQL statement. The end is the ";"


BTW, this is the group for database related questions:
micrsoft.public.dotnet.framework.adonet


Armin
 
Hey Selva,

I've also found someone else encountered this problem. Actually it is
caused by the Access db query engine dosn't support mulitple query
statement batch executing. We may need to use two SqlCommands to execute
the two sqlstatements through the same sqlconnection .... You can also
found the discussion on this in the following thread:

http://forums.asp.net/936743/showpost.aspx

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Selva Chinnasamy" <[email protected]>
| Subject: Batch commands & Ms-Access
| Date: Mon, 12 Dec 2005 13:33:51 -0500
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: w27fw1.pb.com 199.231.49.128
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308263
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi I am using batch commands against Ms-Access and getting an error
| Message "Characters found after end of SQL statement." String
|
| Here is my sql Dim str_screens As String = "Select * from Screens Order by
| ScreenName;Select * from Functions"
|
| How can I fix this problem. Any help is greatly appreciated.
|
| Selva
|
|
|
|
 
Stevan, Thanks for your reply. But I couldn't find an answer for the problem.
Any help to resolve the problem is greatly appreciated.

Selva
 
Steven,

It is not only Access, you cannot use Batch SQL commands in ADONET.

What is it that you want to achieve because even if it did exist than that
Select alone does nothing?

Cor
 
Cor,
The reason I wanted to use Batch Command is to retrive more than one table
using an adapter and make a relationship between the tables.

Also I wanted to read data from multiple DB's and make a relationship
between them. Can you please give me an alternate for doing this?

Thanks In Adavnce
Selva
 
Selva,

If you use Net 1.x than you need two selects for it.

Net 2.0 has a new feature however that I did not try yet. If you use that
than, just use the create datasource in the Data tab from Visual Studio.

In net 1.x you need just two seperate Fills and add the relation.

See this page for how to create a relation (The tables are here build on
the fly in the sample)

http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761

I hope this helps,

Cor
 
Hey Cor,

It is not only Access, you cannot use Batch SQL commands in ADONET.
====================
I don't quite think so, for SQLServer, we can execute two sql query through
single statement in a SqlCommand instance.... And we can let the DataReader
return two ResultSet or let the DataAdpater fill two DataTable into a
DataSet..... e.g:

SqlConnection conn = new
SqlConnection("server=(local);database=ncs;uid=ncs;pwd=ncs;");
SqlCommand cmd = new SqlCommand("select * from ncsuser;select * from
ncshistory", conn);

I've ever done this through both Sql managed provider or OleDbProvider.....
(And for Access ,we can not even execute such mutpile select query through
its query wizard....., so this is DataBase specific, nothing to do with
ADO.NET.....)


Hi Selva,

For your scenario, that you need to query two tables from Access Db and
store them into a single DataSet, we need to execute two select statements
separately and fill them into the same DataSet (specify the table name...),
then we can add the relation for the two DataTables in the DataSet...

e.g:

==============================
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click

Try

Dim conn As OleDbConnection
Dim adapter As OleDbDataAdapter
Dim adapter1 As OleDbDataAdapter

conn = New OleDbConnection("Jet OLEDB:Database Locking
Mode=1;Data
Source=""F:\users\stcheng\workspace\dotnet\CS\winform\WindowsApplication2\bi
n\Debug\Northwind.mdb"";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";")
adapter = New OleDbDataAdapter("select * from Orders", conn)


adapter.Fill(ds, "Orders")

Me.DataGrid1.DataSource = ds
Me.DataGrid1.DataMember = "Orders"


adapter.SelectCommand = New OleDbCommand("select * from [Order
Details]", conn)
adapter.Fill(ds, "Order Details")

Me.DataGrid2.DataSource = ds



Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

End Sub
==========================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Cor Ligthert [MVP]" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Batch commands & Ms-Access
| Date: Tue, 13 Dec 2005 16:33:07 +0100
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308475
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Selva,
|
| If you use Net 1.x than you need two selects for it.
|
| Net 2.0 has a new feature however that I did not try yet. If you use that
| than, just use the create datasource in the Data tab from Visual Studio.
|
| In net 1.x you need just two seperate Fills and add the relation.
|
| See this page for how to create a relation (The tables are here build on
| the fly in the sample)
|
|
http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761
|
| I hope this helps,
|
| Cor
|
|
|
 
Steven,

You are right, my information was wrong, I never tested it (what I did now),
I assumed therefore it was right as I had read it (I will not tell from who
I had read it)

:-)

Thanks.

Cor

Steven Cheng said:
Hey Cor,

It is not only Access, you cannot use Batch SQL commands in ADONET.
====================
I don't quite think so, for SQLServer, we can execute two sql query
through
single statement in a SqlCommand instance.... And we can let the
DataReader
return two ResultSet or let the DataAdpater fill two DataTable into a
DataSet..... e.g:

SqlConnection conn = new
SqlConnection("server=(local);database=ncs;uid=ncs;pwd=ncs;");
SqlCommand cmd = new SqlCommand("select * from ncsuser;select * from
ncshistory", conn);

I've ever done this through both Sql managed provider or
OleDbProvider.....
(And for Access ,we can not even execute such mutpile select query through
its query wizard....., so this is DataBase specific, nothing to do with
ADO.NET.....)


Hi Selva,

For your scenario, that you need to query two tables from Access Db and
store them into a single DataSet, we need to execute two select statements
separately and fill them into the same DataSet (specify the table
name...),
then we can add the relation for the two DataTables in the DataSet...

e.g:

==============================
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click

Try

Dim conn As OleDbConnection
Dim adapter As OleDbDataAdapter
Dim adapter1 As OleDbDataAdapter

conn = New OleDbConnection("Jet OLEDB:Database Locking
Mode=1;Data
Source=""F:\users\stcheng\workspace\dotnet\CS\winform\WindowsApplication2\bi
n\Debug\Northwind.mdb"";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";")
adapter = New OleDbDataAdapter("select * from Orders", conn)


adapter.Fill(ds, "Orders")

Me.DataGrid1.DataSource = ds
Me.DataGrid1.DataMember = "Orders"


adapter.SelectCommand = New OleDbCommand("select * from [Order
Details]", conn)
adapter.Fill(ds, "Order Details")

Me.DataGrid2.DataSource = ds



Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

End Sub
==========================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Cor Ligthert [MVP]" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Batch commands & Ms-Access
| Date: Tue, 13 Dec 2005 16:33:07 +0100
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308475
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Selva,
|
| If you use Net 1.x than you need two selects for it.
|
| Net 2.0 has a new feature however that I did not try yet. If you use
that
| than, just use the create datasource in the Data tab from Visual Studio.
|
| In net 1.x you need just two seperate Fills and add the relation.
|
| See this page for how to create a relation (The tables are here build
on
| the fly in the sample)
|
|
http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761
|
| I hope this helps,
|
| Cor
|
|
|
 
even better
i combine hundred inserts at once in my sql import application

i also performed multiple DDL statements at once just seprate them with a
; and there you go


:-)

regards

Michel Posseth [MCP]



Steven Cheng said:
Hey Cor,

It is not only Access, you cannot use Batch SQL commands in ADONET.
====================
I don't quite think so, for SQLServer, we can execute two sql query
through
single statement in a SqlCommand instance.... And we can let the
DataReader
return two ResultSet or let the DataAdpater fill two DataTable into a
DataSet..... e.g:

SqlConnection conn = new
SqlConnection("server=(local);database=ncs;uid=ncs;pwd=ncs;");
SqlCommand cmd = new SqlCommand("select * from ncsuser;select * from
ncshistory", conn);

I've ever done this through both Sql managed provider or
OleDbProvider.....
(And for Access ,we can not even execute such mutpile select query through
its query wizard....., so this is DataBase specific, nothing to do with
ADO.NET.....)


Hi Selva,

For your scenario, that you need to query two tables from Access Db and
store them into a single DataSet, we need to execute two select statements
separately and fill them into the same DataSet (specify the table
name...),
then we can add the relation for the two DataTables in the DataSet...

e.g:

==============================
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click

Try

Dim conn As OleDbConnection
Dim adapter As OleDbDataAdapter
Dim adapter1 As OleDbDataAdapter

conn = New OleDbConnection("Jet OLEDB:Database Locking
Mode=1;Data
Source=""F:\users\stcheng\workspace\dotnet\CS\winform\WindowsApplication2\bi
n\Debug\Northwind.mdb"";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";")
adapter = New OleDbDataAdapter("select * from Orders", conn)


adapter.Fill(ds, "Orders")

Me.DataGrid1.DataSource = ds
Me.DataGrid1.DataMember = "Orders"


adapter.SelectCommand = New OleDbCommand("select * from [Order
Details]", conn)
adapter.Fill(ds, "Order Details")

Me.DataGrid2.DataSource = ds



Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

End Sub
==========================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Cor Ligthert [MVP]" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Batch commands & Ms-Access
| Date: Tue, 13 Dec 2005 16:33:07 +0100
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308475
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Selva,
|
| If you use Net 1.x than you need two selects for it.
|
| Net 2.0 has a new feature however that I did not try yet. If you use
that
| than, just use the create datasource in the Data tab from Visual Studio.
|
| In net 1.x you need just two seperate Fills and add the relation.
|
| See this page for how to create a relation (The tables are here build
on
| the fly in the sample)
|
|
http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761
|
| I hope this helps,
|
| Cor
|
|
|
 
Michel,

Het is niet nodig meer zout in de wond te strooien het prikt al genoeg.
(Just a Dutch phrase not important)

I am glad that Steven has showed it to me, I missed this part, if I know one
solution, than I will use it or/and try it on more places.

I hate SQL.

Just kidding of course.

:-)

Cor
 
Michel- When I had couple Select statements seperated with ; I am getting an
error.
I am using OleDb Adapter against Ms-Access.

Is there any Connection setting that I need to aware of.

Thanks
Selva

m.posseth said:
even better
i combine hundred inserts at once in my sql import application

i also performed multiple DDL statements at once just seprate them with a
; and there you go


:-)

regards

Michel Posseth [MCP]



Steven Cheng said:
Hey Cor,

It is not only Access, you cannot use Batch SQL commands in ADONET.
====================
I don't quite think so, for SQLServer, we can execute two sql query
through
single statement in a SqlCommand instance.... And we can let the
DataReader
return two ResultSet or let the DataAdpater fill two DataTable into a
DataSet..... e.g:

SqlConnection conn = new
SqlConnection("server=(local);database=ncs;uid=ncs;pwd=ncs;");
SqlCommand cmd = new SqlCommand("select * from ncsuser;select * from
ncshistory", conn);

I've ever done this through both Sql managed provider or
OleDbProvider.....
(And for Access ,we can not even execute such mutpile select query through
its query wizard....., so this is DataBase specific, nothing to do with
ADO.NET.....)


Hi Selva,

For your scenario, that you need to query two tables from Access Db and
store them into a single DataSet, we need to execute two select statements
separately and fill them into the same DataSet (specify the table
name...),
then we can add the relation for the two DataTables in the DataSet...

e.g:

==============================
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoad.Click

Try

Dim conn As OleDbConnection
Dim adapter As OleDbDataAdapter
Dim adapter1 As OleDbDataAdapter

conn = New OleDbConnection("Jet OLEDB:Database Locking
Mode=1;Data
Source=""F:\users\stcheng\workspace\dotnet\CS\winform\WindowsApplication2\bi
n\Debug\Northwind.mdb"";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";")
adapter = New OleDbDataAdapter("select * from Orders", conn)


adapter.Fill(ds, "Orders")

Me.DataGrid1.DataSource = ds
Me.DataGrid1.DataMember = "Orders"


adapter.SelectCommand = New OleDbCommand("select * from [Order
Details]", conn)
adapter.Fill(ds, "Order Details")

Me.DataGrid2.DataSource = ds



Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

End Sub
==========================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Cor Ligthert [MVP]" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Batch commands & Ms-Access
| Date: Tue, 13 Dec 2005 16:33:07 +0100
| Lines: 19
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308475
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Selva,
|
| If you use Net 1.x than you need two selects for it.
|
| Net 2.0 has a new feature however that I did not try yet. If you use
that
| than, just use the create datasource in the Data tab from Visual Studio.
|
| In net 1.x you need just two seperate Fills and add the relation.
|
| See this page for how to create a relation (The tables are here build
on
| the fly in the sample)
|
|
http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761
|
| I hope this helps,
|
| Cor
|
|
|
 
Hey Selva,

Your ADO.NET code is correct and nothing wrong here. The limitation here is
due to the Access DataBase's query enging which doesn't support multiple
querystatements ......

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Batch commands & Ms-Access
| thread-index: AcYCStP5u936hkiDTxq9tTJbVoupYw==
| X-WBNR-Posting-Host: 199.231.49.128
| From: "=?Utf-8?B?U2VsdmE=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Batch commands & Ms-Access
| Date: Fri, 16 Dec 2005 06:13:03 -0800
| Lines: 160
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:308928
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Michel- When I had couple Select statements seperated with ; I am getting
an
| error.
| I am using OleDb Adapter against Ms-Access.
|
| Is there any Connection setting that I need to aware of.
|
| Thanks
| Selva
|
| "m.posseth" wrote:
|
| > even better
| > i combine hundred inserts at once in my sql import application
| >
| > i also performed multiple DDL statements at once just seprate them
with a
| > ; and there you go
| >
| >
| > :-)
| >
| > regards
| >
| > Michel Posseth [MCP]
| >
| >
| >
| > | > > Hey Cor,
| > >
| > > It is not only Access, you cannot use Batch SQL commands in ADONET.
| > > ====================
| > > I don't quite think so, for SQLServer, we can execute two sql query
| > > through
| > > single statement in a SqlCommand instance.... And we can let the
| > > DataReader
| > > return two ResultSet or let the DataAdpater fill two DataTable into a
| > > DataSet..... e.g:
| > >
| > > SqlConnection conn = new
| > > SqlConnection("server=(local);database=ncs;uid=ncs;pwd=ncs;");
| > > SqlCommand cmd = new SqlCommand("select * from ncsuser;select * from
| > > ncshistory", conn);
| > >
| > > I've ever done this through both Sql managed provider or
| > > OleDbProvider.....
| > > (And for Access ,we can not even execute such mutpile select query
through
| > > its query wizard....., so this is DataBase specific, nothing to do
with
| > > ADO.NET.....)
| > >
| > >
| > > Hi Selva,
| > >
| > > For your scenario, that you need to query two tables from Access Db
and
| > > store them into a single DataSet, we need to execute two select
statements
| > > separately and fill them into the same DataSet (specify the table
| > > name...),
| > > then we can add the relation for the two DataTables in the DataSet...
| > >
| > > e.g:
| > >
| > > ==============================
| > > Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As
| > > System.EventArgs) Handles btnLoad.Click
| > >
| > > Try
| > >
| > > Dim conn As OleDbConnection
| > > Dim adapter As OleDbDataAdapter
| > > Dim adapter1 As OleDbDataAdapter
| > >
| > > conn = New OleDbConnection("Jet OLEDB:Database Locking
| > > Mode=1;Data
| > >
Source=""F:\users\stcheng\workspace\dotnet\CS\winform\WindowsApplication2\bi
| > > n\Debug\Northwind.mdb"";Mode=Share Deny None;Jet OLEDB:Engine
| > > Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";")
| > > adapter = New OleDbDataAdapter("select * from Orders",
conn)
| > >
| > >
| > > adapter.Fill(ds, "Orders")
| > >
| > > Me.DataGrid1.DataSource = ds
| > > Me.DataGrid1.DataMember = "Orders"
| > >
| > >
| > > adapter.SelectCommand = New OleDbCommand("select * from
[Order
| > > Details]", conn)
| > > adapter.Fill(ds, "Order Details")
| > >
| > > Me.DataGrid2.DataSource = ds
| > >
| > >
| > >
| > > Catch ex As Exception
| > > MessageBox.Show(ex.ToString())
| > > End Try
| > >
| > > End Sub
| > > ==========================
| > >
| > > Thanks,
| > >
| > > Steven Cheng
| > > Microsoft Online Support
| > >
| > > Get Secure! www.microsoft.com/security
| > > (This posting is provided "AS IS", with no warranties, and confers no
| > > rights.)
| > >
| > >
| > >
| > > --------------------
| > > | From: "Cor Ligthert [MVP]" <[email protected]>
| > > | References: <[email protected]>
| > > <[email protected]>
| > > <[email protected]>
| > > <[email protected]>
| > > <[email protected]>
| > > | Subject: Re: Batch commands & Ms-Access
| > > | Date: Tue, 13 Dec 2005 16:33:07 +0100
| > > | Lines: 19
| > > | X-Priority: 3
| > > | X-MSMail-Priority: Normal
| > > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > > | X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > > | X-RFC2646: Format=Flowed; Original
| > > | Message-ID: <[email protected]>
| > > | Newsgroups: microsoft.public.dotnet.languages.vb
| > > | NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| > > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > > | Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.languages.vb:308475
| > > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > > |
| > > | Selva,
| > > |
| > > | If you use Net 1.x than you need two selects for it.
| > > |
| > > | Net 2.0 has a new feature however that I did not try yet. If you
use
| > > that
| > > | than, just use the create datasource in the Data tab from Visual
Studio.
| > > |
| > > | In net 1.x you need just two seperate Fills and add the relation.
| > > |
| > > | See this page for how to create a relation (The tables are here
build
| > > on
| > > | the fly in the sample)
| > > |
| > > |
| > >
http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761
| > > |
| > > | I hope this helps,
| > > |
| > > | Cor
| > > |
| > > |
| > > |
| > >
| >
| >
| >
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top