View previous topic :: View next topic |
Author |
Message |
Zack
Joined: 27 Mar 2007 Posts: 2 Location: Johannesburg
|
Posted: Tue Mar 27, 2007 12:18 am Post subject: Update Access database |
|
|
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 |
|
Tech Support
Joined: 25 Aug 2003 Posts: 4387
|
Posted: Tue Mar 27, 2007 8:29 am Post subject: |
|
|
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. |
|
Back to top |
|
Zack
Joined: 27 Mar 2007 Posts: 2 Location: Johannesburg
|
Posted: Wed Mar 28, 2007 5:29 am Post subject: |
|
|
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 |
|
Tech Support
Joined: 25 Aug 2003 Posts: 4387
|
Posted: Wed Mar 28, 2007 8:06 am Post subject: |
|
|
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. |
|
Back to top |
|
|