• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write data into access database?

 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
One of my course study needs me to update data to a database.
I am using MS.access and i am not able to insert or append any data into the data base. I am able to get connected, draw and process datas from ms-access. Pls friends, let me know the method to do it.
with regards
Ramesh.
------------------
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
statement.executeUpdate(String sql)
If you are having problems maybe you can show the code snippet.
 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, here given below is my coding which works fine.
In this coding i want to update database with a new
userID and password. That is where my problem starts.
help me to do it.
thanks a lot.
// yahoo password checking


[This message has been edited by maha anna (edited December 08, 2000).]
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramesh,
In your code I couldn't get the need for 'updating the database'. What you are doind is just query the database compare the user's login and password and take action accordingly.
.executeQuery is for selecting records
.executeUpdate is for making changes to the database records.
Can you tell us the reason , you want to update the database?
regds
maha anna
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you show us the code you are using that isn't working.
 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi MahaLakshmi, Nice to meet u.
In my code, I want to update the database with the user name
and password if it already doesn't exist.
It is just like creating a new account in yahoo if the user dont
have any ID?.
I hope now u understand my needs.
Thanks
with regards
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what's the problem? Is it not working or is it that you don't know how to do it? If it isn't working, then show us the code you are using.
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your else { } block of code you have to do the insert. Modify this code to your variables and table col names.

[This message has been edited by maha anna (edited December 08, 2000).]
 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks maha,
I'll try your code now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic