NotePage, Inc. Forum Index

Update Access database

 
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> General Questions and Announcements
View previous topic :: View next topic  
Author Message
Zack



Joined: 27 Mar 2007
Posts: 2
Location: Johannesburg

PostPosted: Tue Mar 27, 2007 12:18 am    Post subject: Update Access database Reply with quote

Hi there,
I used to be pretty OK with VB6.
The code I am listing is from a VB2005 app.
I need the code to be added to the bottom to save the changes back to the database.
Thanks a span.

Dim cn As New ADODB.Connection()
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\duratech.mdb"
cn.Open()

Dim rs As New ADODB.Recordset()
rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient
rs.CursorType = ADODB.CursorTypeEnum.adOpenStatic
rs.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
rs.Open("select * from products", cn)
rs.ActiveConnection = Nothing
cn.Close()

Dim da As New System.Data.OleDb.OleDbDataAdapter()
Dim ds As New DataSet()
da.Fill(ds, rs, "products")
'Dim tt As New DataView
Dim tblAuthors As DataTable
tblAuthors = ds.Tables("products")

Dim drCurrent As DataRow
' Obtain a new DataRow object from the DataTable.
drCurrent = tblAuthors.NewRow()

' Set the DataRow field values as necessary.
drCurrent("productname") = "993-21-3427"
drCurrent("productdescription") = "George"
tblAuthors.Rows.Add(drCurrent)
'drCurrent = tblAuthors.Rows.Find("993-21-3427")
drCurrent.BeginEdit()
drCurrent("productdescription") = "Peter" '& drCurrent("productdescription").ToString.Substring(3)
drCurrent.EndEdit()



_________________
Zack
Back to top
View user's profile
Tech Support



Joined: 25 Aug 2003
Posts: 4041

PostPosted: Tue Mar 27, 2007 8:29 am    Post subject: Reply with quote

Hi there,

I'm a little confused but then, my knowledge of VB coding isn't exactly stellar. I was wondering how this operates in conjunction with the NotePager Pro or PageGate database standard so I could help.



_________________
Tech Support
support@notepage.com
http://www.notepage.net
Back to top
View user's profile
Zack



Joined: 27 Mar 2007
Posts: 2
Location: Johannesburg

PostPosted: Wed Mar 28, 2007 5:29 am    Post subject: Reply with quote

You response confuses me even further?
I originally did a VB related search on Google and was directed to a posting on your site.
I then made the assumption that this site contains a developers forum as well.
If I was mistaken or posted in the wrong area. please let me know.
regards



_________________
Zack
Back to top
View user's profile
Tech Support



Joined: 25 Aug 2003
Posts: 4041

PostPosted: Wed Mar 28, 2007 8:06 am    Post subject: Reply with quote

Ah, now I understand.

This isn't a developer's forum, it's the Technical Support Forum for the programs NotePager Pro, NotePager Net, WebGate, and PageGate, which are programs that can send SMS to cel phones and pagers.

There are elements of WebGate and PageGate that can be used and activated by VB Script, which is why you saw references to it in the forum.



_________________
Tech Support
support@notepage.com
http://www.notepage.net
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> General Questions and Announcements All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Theme created by Vjacheslav Trushkin