B
barret bonden
Not needing disconnected data, and still somewhat fluent in DAO/ADO I've
played with both in .NET. Can't seem to be able to add a record; too much of
the syntax seems to have been OOP'ed (haven't posted my attempts here , as
they don't work - but below is the flavor of the thing as it stands
Data pops up fine in the textbox and movenext, etc work fine. (hope I'm in
the right newsgroup; if not please direct me -this is as close as I could
find)
Anyone know how to add a record ?
Imports System.Data
Imports System.Data.OleDb
Imports ADODB
Public Class Form1
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim cs1 As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\test.mdb;"
' Dim Conn As New ADODB.Connection
' Dim rs As New ADODB.Recordset
Conn.Provider = cs1
Conn.Open(cs1, "", "", -1)
Dim sql As String
sql = "select * from test"
rs.Open(sql, cs1, ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
rs.MoveFirst()
Dim v1 As String
v1 = rs.Fields.Item(1).Value
TextBox1.Text = v1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
rs.MoveNext()
Dim v1 As String
v1 = rs.Fields.Item(1).Value
TextBox1.Text = v1
end sub
played with both in .NET. Can't seem to be able to add a record; too much of
the syntax seems to have been OOP'ed (haven't posted my attempts here , as
they don't work - but below is the flavor of the thing as it stands
Data pops up fine in the textbox and movenext, etc work fine. (hope I'm in
the right newsgroup; if not please direct me -this is as close as I could
find)
Anyone know how to add a record ?
Imports System.Data
Imports System.Data.OleDb
Imports ADODB
Public Class Form1
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim cs1 As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\test.mdb;"
' Dim Conn As New ADODB.Connection
' Dim rs As New ADODB.Recordset
Conn.Provider = cs1
Conn.Open(cs1, "", "", -1)
Dim sql As String
sql = "select * from test"
rs.Open(sql, cs1, ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
rs.MoveFirst()
Dim v1 As String
v1 = rs.Fields.Item(1).Value
TextBox1.Text = v1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
rs.MoveNext()
Dim v1 As String
v1 = rs.Fields.Item(1).Value
TextBox1.Text = v1
end sub