This following piece of code wont work, i have no idea what i did
wrong.
Data.mdb is the database file
Admin is the table
username and password are fields
oldpasstxt.Text and newpasstxt.Text are from input boxes.
The error vs.net gives me is
olecmd.ExecuteN onQuery()
on the 3rd last line of what i pasted.
any help would be deeply appreciated :{
code:
Private Sub okchange_btn_Cl ick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles okchange_btn.Cl ick
Dim conn As OleDbConnection
Dim query As String
Dim adapter As OleDbDataAdapte r
Dim ds As DataSet
Dim connstring As String
Dim olecmd As OleDbCommand
Dim ole As String
connstring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=Data.mdb ;
Jet OLEDB:database password=passwo rd"
conn = New OleDbConnection (connstring)
query = "select * from Admin where username = 'admin' and Password =
'" & oldpasstxt.Text & "'"
olecmd = New OleDbCommand(qu ery, conn)
conn.Open()
Dim dr = olecmd.ExecuteR eader(CommandBe havior.CloseCon nection)
If dr.Read = True Then
connstring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=Logick.c os;
Jet OLEDB:database password=cosmic logick"
conn = New OleDbConnection (connstring)
query = "UPDATE Admin SET password = ('" & newpasstxt.Text &
"') where username = 'admin'"
olecmd = New OleDbCommand(qu ery, conn)
conn.Open()
olecmd = New OleDbCommand(qu ery, conn)
olecmd.ExecuteN onQuery()
conn.Close()
End Sub 1 1261
Hi,
Why dont you create a new connection and command variable instead of
using the old ones after you check to see you can update the other database.
Please post the exact error message.
Ken
-------------------------
"CosmicLogi ck" <lo****@ananzi. co-dot-za.no-spam.invalid> wrote in message
news:40******** **@127.0.0.1... This following piece of code wont work, i have no idea what i did wrong. Data.mdb is the database file Admin is the table username and password are fields oldpasstxt.Text and newpasstxt.Text are from input boxes. The error vs.net gives me is
olecmd.ExecuteN onQuery()
on the 3rd last line of what i pasted. any help would be deeply appreciated :{
code:
Private Sub okchange_btn_Cl ick(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles okchange_btn.Cl ick
Dim conn As OleDbConnection Dim query As String Dim adapter As OleDbDataAdapte r Dim ds As DataSet Dim connstring As String Dim olecmd As OleDbCommand Dim ole As String
connstring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=Data.mdb ; Jet OLEDB:database password=passwo rd" conn = New OleDbConnection (connstring) query = "select * from Admin where username = 'admin' and Password = '" & oldpasstxt.Text & "'" olecmd = New OleDbCommand(qu ery, conn) conn.Open() Dim dr = olecmd.ExecuteR eader(CommandBe havior.CloseCon nection) If dr.Read = True Then connstring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=Logick.c os; Jet OLEDB:database password=cosmic logick" conn = New OleDbConnection (connstring) query = "UPDATE Admin SET password = ('" & newpasstxt.Text & "') where username = 'admin'" olecmd = New OleDbCommand(qu ery, conn) conn.Open() olecmd = New OleDbCommand(qu ery, conn) olecmd.ExecuteN onQuery() conn.Close()
End Sub This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Matt |
last post by:
I'd like to overwrite just one line of a binary file, based on a
position set by seek(). Is there no way to do this? As far as I can
tell I need to read the whole file, change the line, and write it all
back out. Not exactly easy on the memory, but I see no other solution.
so far:
patchme.seek(offset)
patchme.write(a2b_hex(edit)) # the data is in hex first
patchme.close
|
by: Christo |
last post by:
borland c++ 5.01
character constant must be one or two characters long
get this when compiling my first c++ program can anyone out there help?
it is highlighting this line as the problem
cout << "Please Enter First number: ";
|
by: Anupam Kapoor |
last post by:
hi all,
a python n00b, so please bear with me. i have a simple question:
i generally name python sources as a-simple-python-example.py. when i
try to import a module named as above, i (obviously) get tracebacks
from python interpreter.
is there a way to continue naming python sources as above, and still
use it as python modules ? i can ofcourse change the name to
|
by: newgenre |
last post by:
I am using a pre-built package of code for my site, which is called
EasyDisc. All it does is it creates an interactive forum on your site, like
any forum you see anywhere.
I am having a problem getting started as I am new to .NET and sql. The app,
once unzipped, tells me to "Make note of your SQL server name, username,
password, database name. You need to supply these info. later."
My problem is I don't know where to find out that info....
|
by: ducky |
last post by:
Hi all,
The only programming experience i have under my belt so far is VB. I'm
just starting out on C++ and wonder if anybody suggests and good (free)
starting points for me to get going. I'm wondering about tutorials,
source code, etc... Stuff that will take me from absolute square 1.
Also, which compilers would be suggested? i have the bloodshed one and
microsoft's visual studio express version as well. Are there any
others that...
| |
by: HardHackz |
last post by:
Hey, I'm trying to learn C++, the problem is, when I do cout << "Hello
World!"; it always opens dos and closes it to quickly to see...i know
im a total n00b, but any help?
|
by: hockeyjk |
last post by:
All,
I'm writing a program that creates a histogram of data. IDLE is freezing up after the window opens (doesn't prompt user or graph anything). The window that opens is named "tk" rather than the name I assign to it.
Can anyone shed light on why.
EDIT: Nevermind. The error was resulting because I was attempting to run the file from my flash drive. Who knew. n00b.
Can an admin delete this thread?
|
by: benwah1983 |
last post by:
Greetings,
Here is my problem:
The following code shows a div with two small nested divs (images with a title), then the div is closed. Another one opens and a "random text" is displayed.
<div style="width: 500px;">
<div style="float: left; padding: 20px;">
Image Title 1<br/>
<img src="test.jpg"/>
</div>
<div style="float: left; padding: 20px;">
|
by: ig |
last post by:
First off, I'm a python n00b, so feel free to comment on anything if
I'm doing it "the wrong way." I'm building a discrete event simulation
tool. I wanted to use coroutines. However, I want to know if there's
any way to hide a yield statement.
I have a class that I'd like to look like this:
class Pinger(Actor):
def go(self):
success = True
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |