Write to Access DB from Vantage 8

Adam,

Thanks for the info. This really helps gets me started.

Scott

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
adamtuliper
Sent: Thursday, April 19, 2007 6:44 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Write to Access DB from Vantage 8



its a matter (for instance)
1. add button to your form
2. open connection to access mdb. (ado.net)
3. create new record (ado.net) using loaded screen data or use the
appropriate business objects to load data.
4. close connection
5. dispose objects

simplest example would go something like the following (not compiled,
off top of head- sorry if there are errors)

Dim cn As OleDbConnection
Dim cmd As OleDbCommand

Try
cn = New OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\MyDatabase.mdb;Persist Security Info=False")
cn.Open()
cmd = New OleDbCommand("Insert Into SomeTable Values
(""val1"", ""val2"")", cn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

cn.Close()
cn.Dispose()



accessing the information (here is somethign I did to load a
customer - you could do same thing for your data upon request or by
using the existing loaded data (search for a post on here using my
name - something came up in the past to get data from loaded form
data)

-------
Dim custAdapt As CustomerAdapter = New CustomerAdapter
(CustomerEntryForm)

Dim dr As DataRow = custAdapt.CustomerData.Tables("ShipTo").NewRow
()
custAdapt.BOCOnnect()
custAdapt.GetByCustId("ACC007")
dim custNum as Integer = custAdapt.CustomerData.Tables
("Customer").Rows(0)("CustNum")
custAdapt.GetNewShipTo(custNum)
custAdapt.CustomerData.Tables("ShipTo").Rows(0)("ShipToNum")
="Test"
Try
custAdapt.Update()
Catch ex as Exception
MessageBox.Show(ex.ToString())
End try
--------------


have fun,
Adam


--- In vantage@yahoogroups.com, "Scott Litzau" <scott.litzau@...>
wrote:
>
> I actually want to write out to a intermediate Access DB from
Vantage and
> then have Worldship read that Access DB.
>
> I haven't upgrade to WS 9 yet but was planning on it soon. Thanks
for the
> heads up.
>
> Scott
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf Of
> Edward F. Fox, Jr.
> Sent: Thursday, April 19, 2007 1:04 PM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Write to Access DB from Vantage 8
>
>
> Just a heads up. Worldship 9.0 is MSSQL and not Access anymore.
>
>
> Edward F. Fox, Jr., CPA
>
> Controller
>
> Maxson Automatic Machinery Company
>
> Phone 401-596-0162 Fax 401-596-1050
>
> www.maxsonautomatic.com <http://www.maxsonautomatic.com/>
>
>
>
> _____
>
> From: Scott Litzau [mailto:scott.litzau@...]
> Sent: Thursday, April 19, 2007 1:54 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Write to Access DB from Vantage 8
>
>
>
> Does anyone have a example (code) on how to write to an Access DB
from
> Vantage. I want to populate an Access DB with Order Information to
be
> able to pull it into UPS Worlship.
>
> Thanks,
>
> Scott Litzau
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You
must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report
Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/links
> Yahoo! Groups Links
>




Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/links
Yahoo! Groups Links
Does anyone have a example (code) on how to write to an Access DB from
Vantage. I want to populate an Access DB with Order Information to be
able to pull it into UPS Worlship.

Thanks,

Scott Litzau
Just a heads up. Worldship 9.0 is MSSQL and not Access anymore.


Edward F. Fox, Jr., CPA

Controller

Maxson Automatic Machinery Company

Phone 401-596-0162 a Fax 401-596-1050

www.maxsonautomatic.com <http://www.maxsonautomatic.com/>



_____

From: Scott Litzau [mailto:scott.litzau@...]
Sent: Thursday, April 19, 2007 1:54 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Write to Access DB from Vantage 8



Does anyone have a example (code) on how to write to an Access DB from
Vantage. I want to populate an Access DB with Order Information to be
able to pull it into UPS Worlship.

Thanks,

Scott Litzau






[Non-text portions of this message have been removed]
I actually want to write out to a intermediate Access DB from Vantage and
then have Worldship read that Access DB.

I haven't upgrade to WS 9 yet but was planning on it soon. Thanks for the
heads up.

Scott

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Edward F. Fox, Jr.
Sent: Thursday, April 19, 2007 1:04 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Write to Access DB from Vantage 8


Just a heads up. Worldship 9.0 is MSSQL and not Access anymore.


Edward F. Fox, Jr., CPA

Controller

Maxson Automatic Machinery Company

Phone 401-596-0162 Fax 401-596-1050

www.maxsonautomatic.com <http://www.maxsonautomatic.com/>



_____

From: Scott Litzau [mailto:scott.litzau@...]
Sent: Thursday, April 19, 2007 1:54 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Write to Access DB from Vantage 8



Does anyone have a example (code) on how to write to an Access DB from
Vantage. I want to populate an Access DB with Order Information to be
able to pull it into UPS Worlship.

Thanks,

Scott Litzau






[Non-text portions of this message have been removed]



Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/links
Yahoo! Groups Links
its a matter (for instance)
1. add button to your form
2. open connection to access mdb. (ado.net)
3. create new record (ado.net) using loaded screen data or use the
appropriate business objects to load data.
4. close connection
5. dispose objects

simplest example would go something like the following (not compiled,
off top of head- sorry if there are errors)

Dim cn As OleDbConnection
Dim cmd As OleDbCommand

Try
cn = New OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\MyDatabase.mdb;Persist Security Info=False")
cn.Open()
cmd = New OleDbCommand("Insert Into SomeTable Values
(""val1"", ""val2"")", cn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try

cn.Close()
cn.Dispose()



accessing the information (here is somethign I did to load a
customer - you could do same thing for your data upon request or by
using the existing loaded data (search for a post on here using my
name - something came up in the past to get data from loaded form
data)

-------
Dim custAdapt As CustomerAdapter = New CustomerAdapter
(CustomerEntryForm)

Dim dr As DataRow = custAdapt.CustomerData.Tables("ShipTo").NewRow
()
custAdapt.BOCOnnect()
custAdapt.GetByCustId("ACC007")
dim custNum as Integer = custAdapt.CustomerData.Tables
("Customer").Rows(0)("CustNum")
custAdapt.GetNewShipTo(custNum)
custAdapt.CustomerData.Tables("ShipTo").Rows(0)("ShipToNum")
="Test"
Try
custAdapt.Update()
Catch ex as Exception
MessageBox.Show(ex.ToString())
End try
--------------


have fun,
Adam


--- In vantage@yahoogroups.com, "Scott Litzau" <scott.litzau@...>
wrote:
>
> I actually want to write out to a intermediate Access DB from
Vantage and
> then have Worldship read that Access DB.
>
> I haven't upgrade to WS 9 yet but was planning on it soon. Thanks
for the
> heads up.
>
> Scott
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf Of
> Edward F. Fox, Jr.
> Sent: Thursday, April 19, 2007 1:04 PM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Write to Access DB from Vantage 8
>
>
> Just a heads up. Worldship 9.0 is MSSQL and not Access anymore.
>
>
> Edward F. Fox, Jr., CPA
>
> Controller
>
> Maxson Automatic Machinery Company
>
> Phone 401-596-0162 Fax 401-596-1050
>
> www.maxsonautomatic.com <http://www.maxsonautomatic.com/>
>
>
>
> _____
>
> From: Scott Litzau [mailto:scott.litzau@...]
> Sent: Thursday, April 19, 2007 1:54 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Write to Access DB from Vantage 8
>
>
>
> Does anyone have a example (code) on how to write to an Access DB
from
> Vantage. I want to populate an Access DB with Order Information to
be
> able to pull it into UPS Worlship.
>
> Thanks,
>
> Scott Litzau
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You
must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report
Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/links
> Yahoo! Groups Links
>