B
barret bonden
I get :"An unhandled exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll" at line
"Dim rec As Integer = cmd.ExecuteNonQuery()" when running:
Dim cs As String
cs = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=C:\backup\laptop\debt\benifits.mdb;Mode=ReadWrite|Share Deny None;"
Dim cn As New OleDbConnection(cs)
cn.Open()
' Dim sql As String = "insert into t (first,last) values
('tom','jefferson')"
Dim sql As String = "insert into t (first) values ('tom')"
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandText = sql
Dim rec As Integer = cmd.ExecuteNonQuery()
'cmd.ExecuteNonQuery()
'Debug.WriteLine(rec)
cn.Close()
this from page 725"programming MS vb net." MS press. I do note that I
finally got something working ! the code below runs !!!!
'page 708 MS programming ms vb net balena
'Ok connected mode skip with console write
Dim con1 As New ADODB.Connection
con1.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=C:\backup\laptop\debt\benifits.mdb;Mode=ReadWrite|Share Deny None;")
Dim r1 As New ADODB.Recordset
Dim s1 As String
'r1.Open("select * from benifits", con1, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
r1.Open("select * from t", con1, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
Do Until r1.EOF
s1 = r1("first").Value
' Console.WriteLine(r1("creditors").Value)
Console.WriteLine(s1)
r1.MoveNext()
Loop
r1.Close()
con1.Close()
I have no idea why the book goes from ADOB connection to Oledb connections
I wish someone would invent Dbase for windows- something simple and
effective.
occurred in system.data.dll" at line
"Dim rec As Integer = cmd.ExecuteNonQuery()" when running:
Dim cs As String
cs = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=C:\backup\laptop\debt\benifits.mdb;Mode=ReadWrite|Share Deny None;"
Dim cn As New OleDbConnection(cs)
cn.Open()
' Dim sql As String = "insert into t (first,last) values
('tom','jefferson')"
Dim sql As String = "insert into t (first) values ('tom')"
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandText = sql
Dim rec As Integer = cmd.ExecuteNonQuery()
'cmd.ExecuteNonQuery()
'Debug.WriteLine(rec)
cn.Close()
this from page 725"programming MS vb net." MS press. I do note that I
finally got something working ! the code below runs !!!!
'page 708 MS programming ms vb net balena
'Ok connected mode skip with console write
Dim con1 As New ADODB.Connection
con1.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=C:\backup\laptop\debt\benifits.mdb;Mode=ReadWrite|Share Deny None;")
Dim r1 As New ADODB.Recordset
Dim s1 As String
'r1.Open("select * from benifits", con1, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
r1.Open("select * from t", con1, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
Do Until r1.EOF
s1 = r1("first").Value
' Console.WriteLine(r1("creditors").Value)
Console.WriteLine(s1)
r1.MoveNext()
Loop
r1.Close()
con1.Close()
I have no idea why the book goes from ADOB connection to Oledb connections
I wish someone would invent Dbase for windows- something simple and
effective.