473,385 Members | 1,829 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,385 software developers and data experts.

Updating msacces database

1
I wrote this code in asp.net(vb):
Expand|Select|Wrap|Line Numbers
  1. dim dbconn as New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("../kri1.mdb"))
  2. Dim DBCmd As New OleDbCommand
  3. Dim DBAdap As New OleDbDataAdapter
  4. DBCmd = New oledbCommand("INSERT INTO tabela (@id, @nesto, @ime)", DBConn)
  5. DBCmd.Parameters.Add("@ID", OleDbType.smallint).value= 6
  6. DBCmd.Parameters.Add("@nesto", OleDbType.varchar ).Value = "2"
  7. DBCmd.Parameters.Add("@ime", OleDbType.varchar ).Value = "3"
  8. DBCmd.Connection.Open()
  9. DBCmd.ExecuteNonQuery()
  10.  
and nothing happened in my database and there's no compilation error, pls help
thx anyway
May 14 '09 #1
1 1157
Frinavale
9,735 Expert Mod 8TB
Your SQL statement is incorrect.
You should have an insert statement like:

Expand|Select|Wrap|Line Numbers
  1. Dim sqlStatement As String = _
  2. "INSERT INTO tabela (id, nesto, ime) " _
  3. "VALUES (@id, @nesto, @ime)"
  4.  
Jun 3 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
1
by: zumbar | last post by:
hi, I am writing a java application that connects to a MS Access databse with two fields , Date and amount. I can insert into this datbase using the application. Now , I need to retrieve weekly...
8
by: luis | last post by:
Hi I'm using activestate python 2.4 on win xp 2 ed. and Ms Access 2002 (reading first http://starship.python.net/crew/bwilk/access.html) I have writed the following code def...
0
by: pradeep84 | last post by:
hi.. to all.. i hav created the applet program codes inorder to save the data in the database.... now i hav to view the data using applets.. any specific method is there.... to do that.. ...
2
daffurankan
by: daffurankan | last post by:
HAi , this ankan wanted to know the code how can i change access database password through vb 6.0 code.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.