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

Error Executing Query

Hi All,

I am trying to execute a query in my VB Code for this Access application. THe code i have is:

Dim dbcon227 As Database
Dim qryDeff As QueryDef
Dim dbrs2, rs As Recordset
Dim strSQL As String


strSQL = "Update [Contract Line Items] set CONTRACTNO = tmpContractNo where CONTRACTNO = oldContractNo"
Set dbcon227 = CurrentDb
Set qryDeff = dbcon227.CreateQueryDef("", strSQL)
CurrentDb.Execute (strSQL) <<<--- this is where it breaks!!!

Any suggestions?

Thanks!
Sep 12 '07 #1
2 1069
debasisdas
8,127 Expert 4TB
You need to frame the query properly.
Sep 12 '07 #2
I fixed it already! Seems Access looks for ' ' around the values.

i.e., this code worked
"UPDATE [Contract Line Items] set CONTRACTNO = '" + tmpContractNo + "' where CONTRACTNO = '" + oldContractNo + "'"
Sep 12 '07 #3

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

Similar topics

11
by: David Berry | last post by:
Hi All. I have a SQL Statement on an ASP page that only returns 4 records. When I run it in SQL Server or Query Analyzer it runs in less than a second. When I run it from my ASP page I get: ...
3
by: Dean g | last post by:
Hi, I have a problem with running multiple sql statements using asp. Basically if there is an error with any of the statements inside the query a rollback is done. the sql and rollback work fine,...
4
by: Bryan Tang | last post by:
I built an ASP to search the content in index server. It is ok if search in English. Whenever I search in Chinese, I will got the following error message, CreateRecordset ?u?~ '80004005' ...
2
by: Mal | last post by:
Greetings. I have a perplexing problem....please help. I am having a problem with an insert query. (SQL below) When I run the query via code (executing the SQL string) it crashes Access and...
3
by: Pravin A. Sable | last post by:
Dear All I am trying to execute following cod Sub SubmitBtn_Click(ByVal Sender As Object, ByVal E As EventArgs Dim DBConn As OleDbConnectio Dim DBInsert As New OleDbComman DBConn = New...
1
by: jesmi | last post by:
my code is: U]employee.cfm <html> <head> <title>Employee List</title> </head> <body> <h1>Employee List</h1>
2
ak1dnar
by: ak1dnar | last post by:
Hi, I am getting some sql errors when trying to insert a record to mysql table using asp.net application. Let me explain the scenario for your reference. This asp.net web form is executing...
0
by: hi4murali | last post by:
Facing a strange error in MS SQL Management Studio 2005, when trying to open a new query window, open a table to view data or even run and existing SQL query file. The error text is: An error...
1
by: Roger Trask | last post by:
Web Server: IIS6 PHP Version: 5.2.5 Database: MS SQLEXPRESS 2005 Loaded PDO Drivers: MSSQL, MySQL, ODBC When executing the following script ($dbName, $username, $pw, $myDSN have been changed in...
15
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.