RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 16219 | Replies: 6
Reply
Join Date: Nov 2004
Posts: 13
Reputation: dru987 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
dru987 dru987 is offline Offline
Newbie Poster

how to update an access DB with vb.net?

  #1  
Apr 18th, 2005
i have a mock site im working on in asp.net/vb.net using an access database. after employees log in they can update there employee profile by filling out a form. i need to know the code for updating an access DB with vb.net from the form fields. im lookin for the syntax on the SQL string and the execute commands afterwards. could someone help me with this or perhaps show me your code for some ideas to point me in the right direction?

also, what would be a good DB to use online? i know access well but i've heard that it doesnt work well online because only one person can access the DB at a time. any free DB's out there that i can scoop?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,592
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 35
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: how to update an access DB with vb.net?

  #2  
Apr 19th, 2005
You're asking for a lot. You collect your form data from the properties of the various server controls. The syntax for SQL is the same regardless of the underlying database, more or less. MySQL is a good server-side database program.

If you are completely new to data-drive web development, then you need to break things down into discrete steps.

1) Connect to a database, retrieve information, display it on a page. That will teach you how to interact with your database.

2) Build a form with server controls. When the user submits a form, gather the information and post it back to the user. That will teach you how to gather form data.

3) Put it all together.
Reply With Quote  
Join Date: Nov 2004
Posts: 13
Reputation: dru987 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
dru987 dru987 is offline Offline
Newbie Poster

Re: how to update an access DB with vb.net?

  #3  
Apr 19th, 2005
prob should have been a little more clear with my question. i was just looking for the syntax for an UPDATE with sql (which if i just took 2 seconds i could find myself because i did :cheesy: ) the only question i have now is with a SELECT query i would run ExecuteReader() but this doesn't seem to be right with an update. is there another execute to use?
Reply With Quote  
Join Date: Dec 2004
Posts: 1,592
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 35
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: how to update an access DB with vb.net?

  #4  
Apr 19th, 2005
Oh. Yep, you use .ExecuteNonQuery().
Reply With Quote  
Join Date: Nov 2004
Posts: 13
Reputation: dru987 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
dru987 dru987 is offline Offline
Newbie Poster

Re: how to update an access DB with vb.net?

  #5  
Apr 19th, 2005
pimp, thanks again tgreer
Reply With Quote  
Join Date: May 2008
Posts: 1
Reputation: azaran2oo2 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
azaran2oo2 azaran2oo2 is offline Offline
Newbie Poster

Re: how to update an access DB with vb.net?

  #6  
May 24th, 2008
Hi,
I have a form in which i want to update data if there is a repeated data in tne table. the table is in access, and i use: vb.net2003.
but i recieve the syntax error in update command. will you please help me:
  1. objCmd = New OleDbCommand("UPDATE Table1 WHERE (cname=" & txtcname.Text & " AND network=" & txtnet.Text & ")) set(usb=" & txtusb.Text & ",cd=" & txtcd.Text & ",position=" & txtpos.Text & ",", New OleDbConnection(cmd))
i put cname and network as key in the table.
thx
Last edited by peter_budo : May 24th, 2008 at 8:20 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,336
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 12
Solved Threads: 102
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: how to update an access DB with vb.net?

  #7  
May 24th, 2008
Originally Posted by azaran2oo2 View Post
Hi,
I have a form in which i want to update data if there is a repeated data in tne table. the table is in access, and i use: vb.net2003.
but i recieve the syntax error in update command. will you please help me:
objCmd = New OleDbCommand("UPDATE Table1 WHERE (cname=" & txtcname.Text & " AND network=" & txtnet.Text & ")) set(usb=" & txtusb.Text & ",cd=" & txtcd.Text & ",position=" & txtpos.Text & ",", New OleDbConnection(cmd))

i put cname and network as key in the table.
thx


Hi,

Start your own thread with this question. That way, you'll get the information that you require, and you won't muddle up someone else's thread with a question that might not be directly related...
Alex Cavnar, aka alc6379
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:28 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC