473,699 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run-Time error when editing Database

62 New Member
When I run this code to update my database

Expand|Select|Wrap|Line Numbers
  1. Set AdVehDecp = New ADODB.Connection
  2. Set RsVehDecp = New ADODB.Recordset
  3. AdVehDecp.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\VEHICLE_TRACKER.mdb;"
  4. AdVehDecp.Open
  5. AdVehDecp.CursorLocation = adUseClient
  6. RsVehDecp.Open "SELECT * FROM qryVehSearch;", AdVehDecp, adOpenDynamic, adLockPessimistic
  7. VehNo = Text1(4).Text
  8.             StrSql = "UPDATE tblVEHLIC SET dtmVLISS = '" & Text2(0).Text & "', dtmVLEXP = '" & Text2(1).Text & "'" _
  9.                     & "WHERE txtVEHNO = " & VehNo & ";"
  10.             AdVehDecp.Execute StrSql
  11.             StrSql = "UPDATE tblHPERT SET dtmHPISS = '" & Text2(2).Text & "', dtmHPEXP = '" & Text2(3).Text & "'" _
  12.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  13.             AdVehDecp.Execute StrSql
  14.             StrSql = "UPDATE tblRDWORTH SET dtmRWISS = '" & Text2(4).Text & "', dtmRWEXP = '" & Text2(5).Text & "'" _
  15.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  16.             AdVehDecp.Execute StrSql
  17.             StrSql = "UPDATE tblINSCERT SET dtmICISS = '" & Text2(6).Text & "', dtmICEXP = '" & Text2(7).Text & "'" _
  18.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  19.             AdVehDecp.Execute StrSql
  20.             StrSql = "UPDATE tblMBADVT SET dtmMAISS = '" & Text2(8).Text & "', dtmMAEXP = '" & Text2(9).Text & "'" _
  21.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  22.             AdVehDecp.Execute StrSql
  23.             StrSql = "UPDATE tblHDUTY SET dtmHDISS = '" & Text2(10).Text & "', dtmHDEXP = '" & Text2(11).Text & "'" _
  24.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  25.             AdVehDecp.Execute StrSql
  26.             RsVehDecp.Requery
  27.             CheckDt
  28.  
it gives me an error

RUN-TIME ERROR '-2147217904(8004 0E10)';
NO VALUE GIVEN FOR 1 OR MORE REQUIRED PARAMETER.

Pls which parameter does it require?
Dec 20 '06 #1
11 1514
willakawill
1,646 Top Contributor
When I run this code to update my database

Expand|Select|Wrap|Line Numbers
  1. Set AdVehDecp = New ADODB.Connection
  2. Set RsVehDecp = New ADODB.Recordset
  3. AdVehDecp.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\VEHICLE_TRACKER.mdb;"
  4. AdVehDecp.Open
  5. AdVehDecp.CursorLocation = adUseClient
  6. RsVehDecp.Open "SELECT * FROM qryVehSearch;", AdVehDecp, adOpenDynamic, adLockPessimistic
  7. VehNo = Text1(4).Text
  8.             StrSql = "UPDATE tblVEHLIC SET dtmVLISS = '" & Text2(0).Text & "', dtmVLEXP = '" & Text2(1).Text & "'" _
  9.                     & "WHERE txtVEHNO = " & VehNo & ";"
  10.             AdVehDecp.Execute StrSql
  11.             StrSql = "UPDATE tblHPERT SET dtmHPISS = '" & Text2(2).Text & "', dtmHPEXP = '" & Text2(3).Text & "'" _
  12.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  13.             AdVehDecp.Execute StrSql
  14.             StrSql = "UPDATE tblRDWORTH SET dtmRWISS = '" & Text2(4).Text & "', dtmRWEXP = '" & Text2(5).Text & "'" _
  15.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  16.             AdVehDecp.Execute StrSql
  17.             StrSql = "UPDATE tblINSCERT SET dtmICISS = '" & Text2(6).Text & "', dtmICEXP = '" & Text2(7).Text & "'" _
  18.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  19.             AdVehDecp.Execute StrSql
  20.             StrSql = "UPDATE tblMBADVT SET dtmMAISS = '" & Text2(8).Text & "', dtmMAEXP = '" & Text2(9).Text & "'" _
  21.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  22.             AdVehDecp.Execute StrSql
  23.             StrSql = "UPDATE tblHDUTY SET dtmHDISS = '" & Text2(10).Text & "', dtmHDEXP = '" & Text2(11).Text & "'" _
  24.                     & "WHERE txtVEHNO = " & RsVehDecp("txtVEHNO") & ";"
  25.             AdVehDecp.Execute StrSql
  26.             RsVehDecp.Requery
  27.             CheckDt
  28.  
it gives me an error

RUN-TIME ERROR '-2147217904(8004 0E10)';
NO VALUE GIVEN FOR 1 OR MORE REQUIRED PARAMETER.

Pls which parameter does it require?
Hi you need to debug this code and let it run line by line until you get the error. Then, at least, you will know which statement is causing the problem.
Dec 20 '06 #2
nkechifesie
62 New Member
Hi you need to debug this code and let it run line by line until you get the error. Then, at least, you will know which statement is causing the problem.
Sorry, I forgot to state that. The error was coming from the first line of
AdVehDecp.Execu te StrSql
Dec 20 '06 #3
devonknows
137 New Member
Dont quote me on this, as i cant check it as imnot on my main machine. but whereyou are using

AdVehDecp.Execu te StrSql

try this

AdVehDecp.Execu te StrSql, , AdCmdText.

ADO isnt my big thing, but whenever i use the execute command i put for example

set rs = AdVehDecp.Execu te(StrSql, , AdCmdText)

or

AdVehDecp.Execu te StrSql, , AdCmdText

just a suggestion,

Kind Regards
Devon.
Dec 20 '06 #4
devonknows
137 New Member
Please ignroe the above post, i completely msread the code and i apologise for any misleading i have caused. i will look again when i ave a little more time on my main machine, i have requested removal of the above post as i believe it has no relevance to what you are trying to do.

i will say though i only get that error when i have data missing from one of the fields in the error

ill do a quick debug here
Expand|Select|Wrap|Line Numbers
  1. original
  2.             StrSql = "UPDATE tblVEHLIC SET dtmVLISS = '" & Text2(0).Text & "', dtmVLEXP = '" & Text2(1).Text & "'" _
  3.                     & "WHERE txtVEHNO = " & VehNo & ";"
  4.  
  5.  
  6. i believe it is to do with this
  7.                     & "WHERE txtVEHNO = " & VehNo & ";"
  8.  
  9. you are missing you ' symbols.
  10.                     & "WHERE txtVEHNO = '" & VehNo & "';"
  11.  
Sorry again bout the previous post

Kind Regards
Devon
Dec 20 '06 #5
willakawill
1,646 Top Contributor
Sorry, I forgot to state that. The error was coming from the first line of
AdVehDecp.Execu te StrSql
What type of variable is VehNo
Dec 20 '06 #6
devonknows
137 New Member
What type of variable is VehNo

Either way, if you are going to use " & VarName & " in an sql statemet
you have to put the ' symbols

strSql = "Blah blahblah WHERE blah='" & Variable & "'"

Kind Regards
Devon.
Dec 20 '06 #7
devonknows
137 New Member
also im not sure if you need the ; at the end of your statment like you have here

StrSql = "UPDATE tblVEHLIC SET dtmVLISS = '" & Text2(0).Text & "', dtmVLEXP = '" & Text2(1).Text & "'" _
& "WHERE txtVEHNO = " & VehNo & ";"

try replacing you sql statment with this

StrSql = "UPDATE tblVEHLIC SET dtmVLISS = '" & Text2(0).Text & "', dtmVLEXP = '" & Text2(1).Text & "'" _
"WHERE txtVEHNO = "' & VehNo & "'"
let me know how that goes.

Kind Regards
Devon.
Dec 20 '06 #8
willakawill
1,646 Top Contributor
Either way, if you are going to use " & VarName & " in an sql statemet
you have to put the ' symbols

strSql = "Blah blahblah WHERE blah='" & Variable & "'"

Kind Regards
Devon.
This information is incorrect.
In order to help you we need to know what type this VehNo variable is.
If it is numeric then your assignment is incorrect
VehNo = Text1(4).Text

Should be
VehNo = CInt(Text1(4).T ext)

If it is text then your use is incorrect
& "WHERE txtVEHNO = " & VehNo & ";"

should be
& "WHERE txtVEHNO = '" & VehNo & "';"

The semi-colon at the end of your statement will not cause an error.
Dec 21 '06 #9
nkechifesie
62 New Member
This information is incorrect.
In order to help you we need to know what type this VehNo variable is.
If it is numeric then your assignment is incorrect
VehNo = Text1(4).Text

Should be
VehNo = CInt(Text1(4).T ext)

If it is text then your use is incorrect
& "WHERE txtVEHNO = " & VehNo & ";"

should be
& "WHERE txtVEHNO = '" & VehNo & "';"

The semi-colon at the end of your statement will not cause an error.
What of if it is Date?
Jan 4 '07 #10

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

Similar topics

3
4927
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run filename.py
4
3214
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of my root directory, but I can run asp files from the root directory of my website and I can run htm files from the subdirectories. If I run localhost/mytest.asp
2
2536
by: Jenna Olson | last post by:
Hi all- I've never seen this particular issue addressed, but was wondering if there's anything to support one way or another. Say I have a class: class ManipulateData { public: ManipulateData(const char* Path-To-Some-Text-File) { ... }
7
9069
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files could run simultaneously, but that might break Windows... ;) The problem I had was I couldn't get the files to RUN, only to OPEN. Thanks for the help!!! pseudo-code looks like this
6
2636
by: billr | last post by:
I have developed a small API for taking care of a lot of boiler plate stuff in a multi formed windows application, for example setting up a messaging thread framework. New Forms, in the appllication using the API, are subclassed to a Form contained within the API, and they are controlled (controlled in this instance means, kept alive, displayed and hidden) at runtime by a thread whose responsibility is this sole task. In order to run...
19
5762
by: n0sPaM | last post by:
Is it possible to schedule an .ASPX page to run automatically, say every hour? N.B.
4
1738
by: Wasi Rehman | last post by:
hi friends, I have one webservice which i want to run on win98 system because some reference in that webservice only run in win98, and my ASP.net application is on win2000 pro. I want to call that webservice from my ASP.net application how could i do that........ how can i publish my webservice on win98 , is it possible or not if not then what should i do ........ remember the DLL which is called by my webservice only run on Win98.
13
5079
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow only 1 thread per line Trunk_Thread.ApartmentState = ApartmentState.STA
26
2301
by: Chief | last post by:
Hello i would like to know which syntax do i have to use in order to make a program run other *.exe program and also how to put inputs in it for example i want to to make a program that run other file call try.exe and save all the stdout into a file thanx
8
2646
by: Sean DiZazzo | last post by:
Is there something special you have to do to get a wxPython app to run remotely under xwindows? My Tkinter apps always automatically work that way, so I was surprised to even be confronted with this problem. ~Sean
0
8705
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, 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...
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9196
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8941
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8896
tracyyun
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...
0
7784
agi2029
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...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.