N
nick
I have a class library to insert a new record into a dbf file. I always get
exception "Operation must use an updateable query" when the function is
called by a Asp.Net function. However, the insersion works well when I call
the function using NUnit. The following is the writing dbf code. Any clue?
Thanks.
Class DAL
static public function writedbf()
....
Dim dbfConnectionString as String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\dbfs;Extended Properties=dBase IV;User ID=Admin;Password="
Dim InsertCmdStr As String = "Insert Into wolog (WOTYPE, REF_NO, PRIORITY,
Unit, DEPT, DEPT_ID, PAC2, RQNAME, RQPHONE, SHOP, ASTO, WODATE, OPTR,
LOCATION, COMM1, ESTHR, STATUS, UP, ROOM, FLR) values
('D','D700804','5','90','740','1','2BUS','a','a','SEC','','11/10/2004
2:02:27 PM','login','2 BUS ST a ','a ',0,'N','N','a','')"
Dim cmd As New OleDbCommand(InsertCmdStr, New
OleDbConnection(dbfConnectionString))
cmd.Connection.Open()
Try
REF_NO = cmd.ExecuteScalar()
Catch err As Exception
Throw err
Finally
If Not cmd.Connection Is Nothing Then
cmd.Connection.Close()
End If
End Try
.....
exception "Operation must use an updateable query" when the function is
called by a Asp.Net function. However, the insersion works well when I call
the function using NUnit. The following is the writing dbf code. Any clue?
Thanks.
Class DAL
static public function writedbf()
....
Dim dbfConnectionString as String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\dbfs;Extended Properties=dBase IV;User ID=Admin;Password="
Dim InsertCmdStr As String = "Insert Into wolog (WOTYPE, REF_NO, PRIORITY,
Unit, DEPT, DEPT_ID, PAC2, RQNAME, RQPHONE, SHOP, ASTO, WODATE, OPTR,
LOCATION, COMM1, ESTHR, STATUS, UP, ROOM, FLR) values
('D','D700804','5','90','740','1','2BUS','a','a','SEC','','11/10/2004
2:02:27 PM','login','2 BUS ST a ','a ',0,'N','N','a','')"
Dim cmd As New OleDbCommand(InsertCmdStr, New
OleDbConnection(dbfConnectionString))
cmd.Connection.Open()
Try
REF_NO = cmd.ExecuteScalar()
Catch err As Exception
Throw err
Finally
If Not cmd.Connection Is Nothing Then
cmd.Connection.Close()
End If
End Try
.....