473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to insert record to dbf file via asp net

I have a problem using with dbf file here. I have tried the code below using
VB.NET with no errors. However, I use the exact same code in ASP NET, it
prompt me error when I tried to insert a record.
The error Detail :

ERROR [HY000] [Microsoft][ODBC dBase Driver] Operation must use an
updateable query.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000]
[Microsoft][ODBC dBase Driver] Operation must use an updateable query.

Source Error:

Line 213:
Line 214: Catch ex As OdbcException
Line 215: Throw (ex)
Line 216:
Line 217: Finally

Source File: c:\inetpub\wwwroot\eClinicApp\DownloadVisit.aspx.v b Line:
215

Stack Trace:

[OdbcException: ERROR [HY000] [Microsoft][ODBC dBase Driver] Operation must
use an updateable query.]
eClinicApp.DownloadVisit.btnDownload_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\eClinicApp\DownloadVisit.aspx.v b:215
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain() +1277


The Code for this is as follow,

Dim myCMD As New OdbcCommand

Dim cnSqlServer1 As New
OdbcConnection("CollatingSequence=ASCII;PageTimeou t=600;UserCommitSync=Yes;MaxScanRows=8;DefaultDir= C:\seagate\data;FILEDSN=C:\seagate\data\COY.DBF.ds n;DriverId=21;Deleted=1;Statistics=0;FIL=dBase
III;UID=admin;Driver={Driver do Microsoft dBase
(*.dbf)};MaxBufferSize=2048;Threads=3;SafeTransact ions=0")
myCMD.Connection = cnSqlServer1
myCMD.CommandType = CommandType.Text
myCMD.CommandText = _
"INSERT INTO [VisitD]([ACNO],[NAME],[NRIC],[EMPNO],[DIV]) " & _
"VALUES(" & _
"'" & dsVisit.Tables(0).Rows(0).Item("ACNO") & "', " & _
"'" & dsVisit.Tables(0).Rows(0).Item("NAME") & "', " & _
"'" & dsVisit.Tables(0).Rows(0).Item("NRIC") & "', " & _
"'" & dsVisit.Tables(0).Rows(0).Item("EMPNO") & "', " & _
"'" & dsVisit.Tables(0).Rows(0).Item("DIV") & "') "

Try
myCMD.Connection.Open()
myCMD.ExecuteNonQuery()


Catch ex As OdbcException
Throw (ex)

Finally
myCMD.Connection.Close()
End Try
Does anyone know what happen? Please help.

Regards
Nov 18 '05 #1
0 1817

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mikey P | last post by:
hi all thanks again for all th direction you guys have given me.. i have a partial backend done for uploading graphics to a directory and information into mysql. Now what i'm having problems with...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
2
by: maltchev | last post by:
i need to insert data from an xml file into sql server table. the xml file contains only one record. how to insert the data? how to map the names of the fields in the xml file and the table?...
1
by: ms | last post by:
I am running an insert statement from a dbf file and there is one record causing the insert to fail. A msg. is returned stating it is due to an invalid datatype. There are 2 text fields, 2...
3
by: NuB | last post by:
I have an app that inserts records into a SQL db, I have a file that I'm reading to get the data out of, aka 'records', how can I determine of the record has been inserted into the database so i...
4
by: Mike Hnatt | last post by:
My goal is to get data from an XML file into a couple of tables in an Access database. The XML file is a little complex so I need control over what I do (I can't just read it into a dataset). ...
5
by: the other john | last post by:
I want to insert a record into a DB and then immediately recall what the ID is. I have heard that there is a way to do this with SQL Server (although I haven't done it yet). Unfortunately this is...
0
ak1dnar
by: ak1dnar | last post by:
There is a Error getting while i am entering records using this jsp file. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <%@ include...
10
by: MLH | last post by:
Suppose, in a multi-user environment, you have append query SQL in a VBA procedure that looks like INSERT INTO MyTable... and the next line reads MyVar=DMax("","MyTable... You can never be...
8
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.