General :: Unexpected Syntax Error On Update

Sep 19, 2012

I have a website which uses a series oif ASP/VBscript scripts to access and update an Access database. It has run for years on a shared commercial service.I also have a replica of the wesbite on my home pc for development and testing running under XP Pro and IIS. All works fine.

Recently I have had to switch my home setup to my laptop (also XP Pro and IIS). The scripts all appear to work ok except when I try to UPDATE certain tables.

Some give "Syntax error in UPDATE statement."
Some give "Data type mismatch in criteria expression."
Some work without error

Yet the identical script and table on the main site and my home PC work fine and have done for years.

View Replies


ADVERTISEMENT

Update Syntax Error

Nov 3, 2006

Obviously a common problem, but my code seems to fit all the correct syntax. I don't understand why it doesn't work...

Code:content_id = request.form("content_id")text = request.form("text")Set Conn = Server.CreateObject("ADODB.Connection")Set RS = Server.CreateObject("ADODB.Recordset")DSNName = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="DSNName = DSNName & Server.MapPath("../../db/axis_content.mdb")Conn.Open DSNNamesql = " UPDATE content SET "sql = sql & " text='" & fcol(text, "a") & "'"sql = sql & " WHERE content_id= " & fcol(content_id, "n")function fcol(indata, typeofdata)indata = trim(indata)if len(indata) = 0 thenfcol = "Null"exit functionend ifselect case typeofdata'a is for words'case "a" fcol = "'" & tsq(indata) & "'"'n is for numbers'case "n" fcol = indata'd is for dates'case "d" fcol = "#" & indata & "#"end selectend function'tsq = two single quotes'function tsq(indata)'replace 1 single quote with 2 single quotes and pass back'tsq = replace(indata, "'", "''")end function
FYI: the content table contains a content_id, section, page, and text

I have been struggling with this for the past week (no joke). Thanks in advance for your help.

View 11 Replies View Related

Syntax Error In UPDATE Statement..

Jun 27, 2005

Hello,

Hopefully this is an easy one! but for the life of me i can't see what im doing wrong , help is appreciated.

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/diary_editE.asp, line 272

SQL = "UPDATE diary SET dte =" & Request.Form("dte") & ", " &_
" eTime= '"& ChkStr(Request.Form("tim")) & "', " & _
" eEnd= '"& ChkStr(Request.Form("endt")) & "', " & _
" text_field = '" & ChkStr(Request.Form("title")) & "', " & _
" eLocation = '" & ChkStr(Request.Form("locat")) & "', " & _
" eContact = '" & ChkStr(Request.Form("conta")) & "', " & _
" eSpeak = '" & ChkStr(Request.Form("speak")) & "', " & _
" eAudiin = '" & ChkStr(Request.Form("audi")) & "', " & _
" eAudiex = '" & ChkStr(Request.Form("aude")) & "', " & _
" eVisitors = '" & ChkStr(Request.Form("evisit")) & "', " & _
" ePromo = '" & ChkStr(Request.Form("prom")) & "', " & _
" details = '" & ChkStr(Request.Form("details")) & "', category = " & Request.Form("cat") & _
" WHERE id = " & Request.Form("ID")


my_conn.Execute SQL

If anymore info is required please tell me, but basically i can insert into the database no problems , but when it comes to updating what is in there i recieve the above error

Thanks in advance

View 3 Replies View Related

Queries :: Syntax Error In Update Statement

Nov 27, 2014

I have 2 tables called MakeTable1 and DBO_TBL_Activity

Im trying to update MakeTable1 with the values from TBL_Activity when both activity.StartDate and maketable1.Dates match but also acticity.IDStaff and Maketable1.ID Match

Below is the SQL i have so far

Code:

UPDATE [MakeTable1].[Detailsa] SET [dbo_tbl_activity].[details]

WHERE [MakeTable1.Dates)=[dbo_tbl_activity].[StartDate] AND [MakeTable1].[id]=[dbo_tbl_activity].[idstaff]);

The error is :syntax error in update statement

View 2 Replies View Related

Queries :: Update Statement With Null Dates - Getting Syntax Error

Jul 5, 2013

My issue is that I am trying to update a date field. When I do the date field may have a date or may be a null. When I try to pass in a NULL date with no quotes, I get a syntax error. When I have single quotes in the statement and a null value is passed in, I get an invalid use of date.

Dim DENIEDDATE1 As Date
If (Not IsDate(rs.Fields("DENIED_DATE"))) Then
DENIEDDATE1 = Null
Else
DENIEDDATE1 = "'" & rs.Fields("DENIED_DATE") & "'"
End If

update table1 set table1.denieddate = " & denieddate1 & " 'get Update syntax error with this statement
update table1 set table1.denieddate = '" & denieddate1 & "' 'fails due to invalid use of null

View 8 Replies View Related

General :: Syntax Error In INSERT INTO Statement

Jul 31, 2012

I'm trying to run the following query

INSERT INTO Enrolled_Students (Last Name, First Name, Address, town/city, county, postcode, phone number, date of birth, age)
SELECT Last Name, First Name, Address, Town/City, County, Postcode, Phone Number, Date of Birth, Age
From Candidate Details
Where IsNumeric (Student ID);

and i'm receiving the error stated above

what im doing wrong?

View 12 Replies View Related

Unexpected Error (40230)

Dec 1, 2005

Ever since I switched from using a Mapped Drive to using the UNC path for my linked tables, i occassionally get Unexpected Error (40230).

I noticed this first when i manually re-linked using the link table manager, it linked the tables, then gave me this error several times, likely reflecting the number of tables i linked, but the links refreshed.

I then noticed this error when i used the acCmdZoom method on a textbox control on a continuous form. It opened the zoom, then gave me the same error several times, likely reflecting the number of records on the form, (i just hit the esc key to scroll through all the errors quickly.)

Any thoughts would be much appreciated,

*** UPDATE, Ok, I just did a Linked Table Manager again, got the error 112 times (or so), which is nowhere near the number of tables linked. After the error occurs once, and you perform that operation again, the error does not happen. Same thing when zooming, the error occurs sever dozens of times, but when i perform the zoom again, it does not repeat the error.

STILL NEED HELP

~Scott

View 8 Replies View Related

General :: Syntax Error Missing Operator In Query Expression

Jul 27, 2012

I've come across a simple error that has me baffled. I continue to receive the run time error 3075: Syntax error (missing operator) in query expression 'tblMasterPersonnel.FirstName"042" Or (tblMasterPersonnel.EmpID)="044"))'

Here is the strSQL

Code:
strSQL = " SELECT tblMasterPersonnel.EmpID, qryiuSSN.SSN, ""SSN"" AS [ID Type], """" AS TXN, tblMasterPersonnel.LastName, " & _
"tblMasterPersonnel.FirstName, tblMasterPersonnel.MI, """" AS Suffix, IIf([tblMasterPersonnel].[Gender]=True,""F"",""M"") AS Gender, " & _
"tblMasterPersonnel.Birthday, tblMasterPersonnel.PlaceBirth, """" AS [Country Code], """" AS Country, tblAddresses.Phone1, " & _
"tblAddresses.Street, tblAddresses.City, tblAddresses.State, tblAddresses.Zip, tblAddresses.Country, " & _

[code]....

View 4 Replies View Related

Unexpected Error From External Database Driver

Jun 14, 2006

I am getting this error message:
"Unexpected Error from External Database Driver" when I try to import some .dbf files into Access. I just did some quick research, and it was suggested that I remove or rename the borland driver. Not sure how I feel about attempting that, plus, where do I get a new borland driver once the old is removed/renamed.

View 1 Replies View Related

"Name" Error In Unexpected Places

Dec 28, 2006

I have a basic form that shows employee information. A few of the fields are calculated or lookup fields. Starting with the first record I can go thru all of them just fine (I don't see any errors in the fields). If I look at my 2nd record twice then my combined name field (first name + last name) shows "#Name?". This error does not occur with my 1st record, just the 2nd one. Also, if I go to the end of my records to where a new record is going to be entered then I get extra errors in my 1st record.

It's kind of hard to explain exactly what's happening without pictures. I'll post some if you think it will help.

In any case, I don't see how a calculated field can work the first time thru but not the second time thru.

View 4 Replies View Related

General :: Access Update SQL Run Time Error 3075

Aug 16, 2012

What's wrong with my zSQL string? I am working on it for 2 days and got no where. I want to put a IF statement

(=IF('Report - key'!$B$7="ALL","ALL",'2012 data'!B2))

to a ACCESS Text field using SQL Update. Here is my code:

Dim zSQL As String
Dim zmsg As String
Dim DQ As String

DQ = """"

zSQL = "UPDATE Supplier_Meeting_Planning SET [ID3] = ' " & "=IF(" & "'" & "Report - key" & "'" & "!$B$7=" & DQ & "ALL" & DQ & "," & DQ & "ALL" & DQ & "," & "'" & "2012 data" & "'" & "!B2)"
Debug.Print zSQL
DoCmd.RunSQL zSQL

It is very painful to put ' and " in the string.

View 7 Replies View Related

General :: Update Query Has Error 424 Object Required

Jul 10, 2013

I am trying to create an update query. I am trying to update a field in a table with the current date as a request.

I have a table named tblTest and a field named Date2 that I am trying to update with the current date, the button that the VBA is applied to is in a form name frmTest. This is my code:

Private Sub Command39_Click()
Dim t1 As Date
t1 = Date
db.Execute("update tblTest set tblTest.Date2") = t1
End Sub

But when I press the button I get:
Run time error '424'
Object Required

It highlights the 4th of code....

View 8 Replies View Related

General :: Access 2013 / Error - Not Enough Memory To Update The Display

Dec 16, 2014

I am regularly getting the error "There is not enough free memory to update your display, close unneeded programs and try again"

Access 2013 on a windows 7 machine with 4 processors and 24GB total RAM.

Today I have 14 GB free memory (unbelievable! my first laptop had 136 MB total memory!) when I got this error (Access using 38MB) which makes me believe its not a system memory issue but to do with how much (or quickly) memory is allocated to Access.

View 5 Replies View Related

General :: Populate List Box With Event After Update In Combo Box - Run Time Error 13

Sep 9, 2013

I am trying to populate a list box with an event after update in a combo box. I can get the formula to work using 2 criteria, the problem is i nee to add a third criteria. When I try to add it I get the run-time 13 error.

Here is the code I am trying to use:

Private Sub cboStatusRFQ_AfterUpdate()
Me.cboSupplier.RowSource = "SELECT DISTINCT [Consolidated_Master_Req_Pool.RFQ Contact] " & _
"FROM Consolidated_Master_Req_Pool " & _
"WHERE consolidated_master_req_pool.Complete = FALSE AND [Consolidated_Master_Req_Pool.RFQ Supplier] = '" & Nz(cboStatusRFQ.Value) & "'" And "[cosolidated_master_req_pool.Status] = '" & "[SUPPLIER_RFQ FOLLOW-UP]" & "'" & _
"ORDER BY [Consolidated_Master_Req_Pool.RFQ Contact];"
Me.cboSupplier = Null
End Sub

View 2 Replies View Related

Update Syntax Help

May 11, 2006




then







Code:query = "update table set date='" & srs.fields("docdate") & "', page=" & srs.fields("pagenumber") &_ ", near='" & near1 & "" & drive & irfile & "', image='" & ars.fields("file_name") &_ "', notes='Image not Found on Nearline.' where file_name = '" & ars.fields("file_name") & "'" msgbox query set fixrs = aconn.execute(query)



code to open connection
Code:sub accessconn ' open a connection to access db' set aconn = CreateObject("ADODB.Connection") 'prep connection' set ars = CreateObject("ADODB.Recordset") ' prep recordset' set fixrs = CreateObject("ADODB.Recordset") ' prep recordset' aconn.open "DRIVER={Microsoft Access Driver (*.mdb)};" &_ "DBQ=" & accessfile & ";DefaultDir=;UID=;PWD=;"end sub

View 1 Replies View Related

Syntax Error

Mar 2, 2007

On my form I have 2 radio buttons rdoAll and rdoSpecific. If rdoAll is true then it prints a report. THis part works fine. However if rdoSpecific is true then I make visable combo box to look up an ID. Then when I click the button I want the same form to open but with just the info pertaining to the ID selected. Here is my code:

Private Sub cmdLotHistory_Click()

Dim stDocName As String, stSelection As String

stDocName = "rptLotHistory"

If Me.rdoAll = True Then
DoCmd.OpenReport "rptLotHistory", acViewPreview
End If

If Me.cboLotLU.Value > 0 Then
stSelection = "[LotID] =" & Me![cboLotLU]
End If

DoCmd.OpenReport stDocName, acViewPreview, , stSelection

End Sub

When I choose the ID and click the button I get the message

Run-Time error '3075':

Syntax error (missing operator) in query expression '(LotID
=020806B1585)'.

the 020806B1585 is my ID number.

Debug hightlights the
DoCmd.OpenReport stDocName, acViewPreview, , stSelection

but I'm guessing my real problem lies in the
stSelection = "[LotID] =" & Me![cboLotLU]


Can anyone point me in the right direction?

Thanks,
Rick

View 2 Replies View Related

Syntax Error

Sep 12, 2005

I have a function that builds a filter and it get a syntex error. It has three components and I must be missing something in combining them into the filter. SpecID and ReviewID are numbers. Selected is a checkbox and 'Yes' is a string. Can anyone see the source of the Syntax Error?

Private Function PlanFilter()
Dim strFilter1 As String, strFilter2 As String, strFilter3 As String
strFilter1 = "[SpecID] = " & [Forms]![frmMainEntry]![SpecID]
strFilter2 = "[ReviewID] = " & [Forms]![frmMainEntry].Form!fctlReviewRequests!ReviewID
strFilter3 = "[Selected] = 'Yes'"
gstrFilter = strFilter1 & " And " & strFilter2 & " And " & strFilter3 & ";"
Debug.Print gstrFilter
End Function

Thanks,
PC

View 3 Replies View Related

Syntax Error

Jun 20, 2007

I'm running a VBA query in excel trying to import the field from a table, simple so I thought, any idea on why i'm getting syntax error codes on this part?

Application.StatusBar = "Retrieving Depot Names"
sSQL = "SELECT tbldepot.DepotName 'Depot' " & vbCr & _
"FROM tbldepot, " & vbCr & _
"GROUP BY tbldepot.DepotName "
getSQLintoRange sSQL, Cells(1, iCol), True, True
iCol = iCol + 2


same thing on

'-= DFE =-
'Some manual DFEs have auth code but left at created
'AAP children have the DFE, not parent
Application.StatusBar = "Retrieving DFE Values"
sSQL = "SELECT tbldepot.DepotName 'Depot', " & vbCr & _
" SUM (di.Qty * di.Rate) 'DFEVal' " & vbCr & _
"FROM tblA537 a, tblA537DFE d, tblA537DFEItem di, tblDepot " & vbCr & _
"WHERE tblDepot.DepotID = a.DepotID " & vbCr & _
"AND a.OrderNumber = d.OrderNumber AND d.DFEID = di.DFEID " & vbCr & _
"AND NOT d.Authorisation IS NULL AND d.DFEStatus<>4 " & vbCr & _
"GROUP BY tblDepot.DepotName " & vbCr & _
"ORDER tblDepot.DepotName "
getSQLintoRange sSQL, Cells(1, iCol), True, True
iCol = iCol + 2

View 5 Replies View Related

Any Error With This Syntax?

Jun 26, 2007

Hi All,

As I am really 'Green' in this line, can anyone tell me what wrong with my syntax?

Thanks in advance.


INSERT INTO Depreciation (AssetID,DepreciationAmount,DepreciationDate)
SELECT Assets.AssetID,
CASE WHEN Assets.AssetID FROM Assets not in (SELECT Depreciation.AssetID FROM Depreciation) THEN Month(Assets.DateAcquired)*SLN(Assets.BookValue,As sets.SalvageValue,Assets.DepreciableLife)/12
ELSE SLN(Assets.BookValue,Assets.SalvageValue,Assets.De preciableLife)/12
END,
Format(Me!DepnRunDT, "0")
FROM Status INNER JOIN Assets ON Status.StatusID=Assets.StatusID
WHERE ((Assets.StatusID)=1);

View 1 Replies View Related

Syntax Error

Sep 20, 2007

I am trying to create a query using the SQL view, i get a missing operator error while running this sql

SELECT tblPDInv_Temp.CustId, tblPDInv_Temp.CustName, tblPDInv_Temp.OnHold, tblPDInv_Temp.InvID, tblPDInv_Temp.InvAmt, " & _
"tblPDInv_Temp.AmtPaid, tblPDInv_Temp.DueDate, [InvAmt]-[AmtPaid] AS AmtDue, tblPDInv_Temp.InvStat " & _
"FROM tblPDInv_Temp " & _
"WHERE ((([InvAmt] - [AmtPaid]) <> 0) And ((Date() - [DueDate]) > 0)) " & _
"ORDER BY tblPDInv_Temp.CustName, tblPDInv_Temp.CustID, tblPDInv_Temp.InvID;"

Thanks

View 2 Replies View Related

Syntax Error

May 5, 2005

I use the following code in the After Update Event of the field Lastname to check for a possible duplicate record:

If DCount("*", "[tblPeople]", "[LastName]= '" & Me.Lastname & "' And [PODate] = #" & Me.PODate & "#") Then
......

And it works well.
In case an existing record is found, I want to jump to it.
I tried using the following code, but it gives a syntax error

Me.RecordsetClone.FindFirst "[Lastname] = '" & Me![LastName] & "' And [PODate] = #" & Me.PoDate & "#"
Me.Bookmark = Me.RecordsetClone.Bookmark

Can't figure out what is wrong here.
Any help will be appreciated.

View 4 Replies View Related

Syntax Error?!

Mar 9, 2005

can someone help me here? i'm trying to get a few selected employee from two tables, namely EmployeeParticulars and ProjectAllocation. EmployeeParticulars contained all the employees in the company whereas ProjectAllocation has two fields (PID - the project and EmpID - the employee who is allocated). One project consist of many employees.


Ok, let's move on to my problem now. I'm trying to get those employees who are not involved in a current project. i tried this

Code: Select Emp.Name from EmployeeParticulars Emp, ProjectAllocation Pro where Emp.EmpID <> Pro.EmpID

but it doesnt work. instead in returns me all the employees in the EmployeeParticulars table and on top of that, each employee appears 21 times!(this 21 i believe is from the 21 employees for this particular project) So, it actually runs 21*27(no of employees) = 546 times!

i was supposed to use != but i realise it doesnt not work in MS Access so i used this <> instead. however it does not give me what i want. Can someone assist me please.

I hope I've made my question comprehensive.

View 3 Replies View Related

Syntax Error?

Mar 19, 2005

insert into date (ReqNum, date) values( 1 , '2005-03-20' )

I'm getting a syntax error with that. Does anyone know why?

View 1 Replies View Related

Syntax Error

Jul 6, 2005

Figured it out thanks.

View 1 Replies View Related

Need Help With Syntax Error

Aug 8, 2006

with my code I am having a syntax problem and I am new to asp so I am a little unsure of what needs to be changed.

Please help...

My error Message:
Code:Microsoft VBScript compilation error '800a03ea'Syntax error/addpicks2.asp, line 32values ('" & _username & "', '" & game1 & "', '" & game2 & "', '" & game3 & "', '" & game4 & "','" & game5 & "','" & game6 & "','" & game7 & "','" & game8 & "','" & game9 & "','" & game10 & "','" & game11 & "','" & game12 & "','" & game13 & "','" & game14 & "','" & game15 & "','" & game16 & "', #" & now() & "#)"--------^


My page code:
Code:<%' Declaring variablesDim username, game1, game2, game3, game4, game5, game6, game7, game8, game9, game10, game11, game12, game13, game14, game15, game16, data_source, con, sql_insert' A Function to check if some field entered by user is emptyFunction ChkString(string)If string = "" Then string = " "ChkString = Replace(string, "'", "''")End Function' Receiving values from Formusername = ChkString(Request.Form("username"))game1 = ChkString(Request.Form("game1"))game2 = ChkString(Request.Form("game2"))game3 = ChkString(Request.Form("game3"))game4 = ChkString(Request.Form("game4"))game5 = ChkString(Request.Form("game5"))game6 = ChkString(Request.Form("game6"))game7 = ChkString(Request.Form("game7"))game8 = ChkString(Request.Form("game8"))game9 = ChkString(Request.Form("game9"))game10 = ChkString(Request.Form("game10"))game11 = ChkString(Request.Form("game11"))game12 = ChkString(Request.Form("game12"))game13 = ChkString(Request.Form("game13"))game14 = ChkString(Request.Form("game14"))game15 = ChkString(Request.Form("game15"))game16 = ChkString(Request.Form("game16"))data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ Server.MapPath("access_db/picks.mdb")sql_insert = "insert into week1 (username, game1, game2, game3, game4, game5, game6, game7, game8, game9, game10, game11, game12, game13, game14, game15, game16, entered_on)"values ('" & _username & "', '" & game1 & "', '" & game2 & "', '" & game3 & "', '" & game4 & "','" & game5 & "','" & game6 & "','" & game7 & "','" & game8 & "','" & game9 & "','" & game10 & "','" & game11 & "','" & game12 & "','" & game13 & "','" & game14 & "','" & game15 & "','" & game16 & "', #" & now() & "#)"' Creating Connection Object and opening the databaseSet con = Server.CreateObject("ADODB.Connection")con.Open data_sourcecon.Execute sql_insert' Done. Close the connectioncon.CloseSet con = NothingResponse.Redirect("showweek1.asp")%>

Any help is appreciated, Thanks!

-Anthony

View 2 Replies View Related

Invalid SQL UPDATE Syntax

Jun 23, 2007

I'm using the following SQL to update a table, however it is throwing back an "Invalid UPDATE Syntax" error message.

DoCmd.RunSQL "UPDATE MSysObjects " & _
"SET Database = strInputFileName " & _
"WHERE Not IsNull(Database) ;"

Could someone possibly help me as to what is wrong with it?
Thanks

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved