Help On NotInList SQL Syntax Error Please..

May 13, 2007

Hi All, I'am using the following code to update a table (tbl_CDT) on a NotInList event of a cboBox (CDT) I keep getting a SQL syntax error message, can anyone help resolve the code please

Private Sub CDT_NotInList(NewData As String, Response As Integer)

On Error GoTo CDT_NotInList_Err
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("The CDT " & Chr(34) & NewData & _
Chr(34) & " is not currently listed." & vbCrLf & _
"Would you like to add to the list now?" _
, vbQuestion + vbYesNo, "DentureBase")
If intAnswer = vbYes Then
strSQL = "INSERT INTO tbl_CDT's([CDT_Name]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
MsgBox "The new CDT has been added to the list." _
, vbInformation, "DentureBase"
Response = acDataErrAdded
Else
MsgBox "Please choose a CDT from the list." _
, vbInformation, "DentureBase"
Response = acDataErrContinue
End If
CDT_NotInList_Exit:
Exit Sub
CDT_NotInList_Err:
MsgBox Err.Description, vbCritical, "Error"
Resume CDT_NotInList_Exit


End Sub
Thanks very much

View Replies


ADVERTISEMENT

NotInList Error

Mar 9, 2006

hey
Well I'm haveing some problems here.
When I type something in my combobox that aint in the list it doesnt go to the precedure NotInList.

I need this for both of these comboboxes and I tried an altarnative way with rowsource but that aint working aswell
so here is the code

Private Sub cboReeks_AfterUpdate()
If cboReeks.Text <> cboReeks.RowSource Then
Call Foutmelding("U hebt een foutieve waarde ingevoerd")
cboReeks.Value = ""
End If
End Sub

Private Sub cboRonde_NotInList(NewData As String, Response As Integer)
Response = 0
Call Foutmelding("U hebt een foutieve waarde ingevoerd")
cboRonde.Value = ""
End Sub

Thanks Cobra

View 5 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

INSERT INTO Syntax Error ???

Oct 30, 2005

Hello All,
I'm am writing an App in Java connecting to an MS Access database. I am now getting a syntax error on the following insert into statement:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
source = "jdbc:odbc:DKOperations";
connection = DriverManager.getConnection(source);
Statement stmt = connection.createStatement();
String CustInfoTable = "CUSTOMER_INFORMATION";
stmt.executeUpdate("INSERT INTO " + CustInfoTable + " CUSTOMER_FIRST_NAME VALUES " + CustFirstName);

This is the error:
An SQLException occurred: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

I cannot figure out what the syntax error is. Anyone have an insight on this for me? Most likely something easy that I am missing.


Thanks!

View 1 Replies View Related

Spot The Syntax Error

Jun 27, 2007

Hi there!

My first post here, and I'm hoping some kind soul will be able to help me (as you can tell, I'm a kinda needy type!!) :o

I've got two completely separate databases, for both of which I need to be able to print a single form at a time. No problem there, a report and a bit of code solved that - but only for one of them! This is the successful one:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

stDocName = "Issues"
DoCmd.OpenReport stDocName, acNormal, , "Issue_No = Forms![Concessions]!Issue_No"

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

For my other database, I simply cut & paste the code, then changed the relevant document fields, as below:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

stDocName = "Change Proposal Print"
DoCmd.OpenReport stDocName, acNormal, , "Issue No = Forms![Change Proposals]!Issue No"

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

But when I try to run this, all I get every time is: "Syntax error (missing operator) in query expression '(Issue No = Forms![Change Proposals]!Issue No)'".

I can't for the life of me figure why one works but not the other. I've checked and treble-checked that I've got exactly the right document names. The report is "Change Proposal Print"
The form is "Change Proposals"
The form field criterion is "Issue No" (without an underscore in this one.)

What operator could possibly be missing in the second one, but not the first? Am I being very dense? Can anyone out there help? (Am I asking too many questions in a whiny voice?) :confused:

Cheers,

mike b :D

View 4 Replies View Related

Syntax Error In From Clause

Nov 28, 2007

When I'm runnig the query, I'm getting an error "syntax error in from clause".
I can't enter to "design" mode to find the error.

View 2 Replies View Related

DLookUp Syntax Error Help

Mar 26, 2008

Hello,

I have a table called "ShrinkWrapBinding" where I am supposed to look up a "Price" from. As you see in the code below, I calculate a "totalPackages" number which comes from values in a form. My problem is that when I try to use this value (totalPackages) on the DLookUp function (as seen in this code) it gives me a syntax error exactly on the totalPackages variable. Please note that I added single quotes to the 'totalPackages' variable when I use it on the DLookUp function, and have tried every possible combination (single quotes, double quotes) but still doesn't work. What is it that I'm doing wrong?

Code:
Dim totalPackages As Integer
Dim tempPrice As Double

totalPackages = Me.QuantityBooks1 / Me.ShrinkWrapQty

tempPrice = DLookup("[ShrinkWrapBinding]! [Price]", "ShrinkWrapBinding", "'totalPackages' >= [ShrinkWrapBinding]![RangeField]")


Thank you

View 8 Replies View Related

Insert Into Syntax Error

Apr 2, 2008

Hi

This may be a very silly question but I have the following code which is meant to take data from textboxes, checkboxes etc and insert it into a new record on a table using the INSERT INTO statment. However I am getting a Syntax error in my INSERT INTO statement which i cannot figure out.

Please Help!!?

Private Sub cmdSaveRecord_Click()

Dim SQL As String
Dim Today As String
Dim Ref As String
Dim HK As String
Dim Site As String
Dim Equip As String
Dim Serial As String
Dim Invoice As String
Dim Client As String
Dim HKRef As String
Dim Tested As String
Dim Completed As String
Dim chkHKr As String
Dim Repaired As String
Dim Spares As String
Dim CompDate As String
Dim Exp As String

Today = txtDate
Ref = txtRef
HK = txtHK
Site = txtSite
Equip = txtEquipment
Serial = txtSerial
Invoice = txtInvoice
If cboClient.Column(0) <> Null Then Client = cboClient.Column(0) Else Client = ""
HKRef = txtHKRef
Tested = chkTested.Value
Completed = chkCompleted.Value
chkHKr = chkHK.Value
Repaired = chkRepaired.Value
Spares = chkSpares.Value
CompDate = cldComp.Value
Exp = cldExp.Value


SQL = "INSERT INTO ServiceReport (Date, CallReferenceNo, HongKongFaultNo, Client, Site, Equipment, SerialNo, Tested, Repaired, Spares, HK, ExpectedDate, Completed, InvoiceNo, CompletedDate VALUES (Today, Ref, HK, Site, Equip, Serial, Invoice, Client, HKRef, Tested, Completed, chkHKr, Repaired, Spares, CompDate, Exp)"

DoCmd.RunSQL SQL

View 5 Replies View Related

Syntax Error In From Clause

Apr 11, 2006

Would someone please tell me why I'm getting this error with this query?

select distinct
case_id

from closed cases g

where
sys_curr_date between #01/01/2005# and #12/31/2005#
and aft_case_status = 'O'

and not exists
( select 1 from closed cases X
where X.case_id = g.case_id
and X.aft_case_status = 'C'
and X.sys_curr_date = g.sys_curr_date )
Thanks

View 1 Replies View Related

Syntax Error From Clause

Jun 15, 2007

Hello,

Found this here and was trying to do the following. Delete rows in my table that are dupicates and put them into a new table.

Keep getting a syntax error.

SELECT DISTINCT * FROM tblRaw INTO tblClientcontacts

Anyone know why?

I have a table that has 12,000 rows. Out of those rows are 1600 uniques. I need to delete all the duplicates. Is this a way to do it?

Thanks.

View 1 Replies View Related

Syntax Error In IIF Statement

Feb 20, 2008

Hi,

I need help with the following question.

I got the following error when loading up a form:

IIf(Not IsNull([SubJobName]) Or [SubJobName]<>"",[SubJobName],[JobName]) AS Expr1, [SubJobs].Status

Can you have IIF statement in the query expression? because it said "Syntax
error in string in the above query expression".

The full codes i have in the form load is
Private Sub Form_Load()
strSQL = "SELECT [Jobs].JobID, [SubJobs].IndustryNo, [SubJobs].ClientNo, [SubJobs].JobNo, [SubJobs].SubJobNo, IIf(Not IsNull([SubJobName]) Or [SubJobName]<>"",[SubJobName],[JobName]) AS Expr1, [SubJobs].Status"
strSQL = strSQL & " FROM [SubJobs] INNER JOIN [Jobs] ON ([SubJobs].JobNo = [Jobs].JobNo) AND ([SubJobs].ClientNo = [Jobs].ClientNo) AND ([SubJobs].IndustryNo = [Jobs].IndustryNo)"
strSQL = strSQL & " WHERE ((([SubJobs].Status) = -1))"

Me!ListBox_Jobs.RowSource = strSQL

End Sub


Thank you in advance

View 1 Replies View Related

Syntax Error In FROM Claus

Feb 17, 2005

ok, i had created a form and wanted to add a couple new fields. so i did so in the related table and then continued to create a new form with all the fields i already had plus the new ones. (by the way half of the fields are from one table and half from another). The first time i created it through the form wizard it worked. however, i had forgotten a few fields, (fields with address and phone # information). so i deleted it and went back through the wizard and included all the fields i needed but this time after i completed the wizard an access window box popped up and said "The wizard is unable to open your form in Form view or Datasheet view, possibly because another user has a source table open in exclusive mode. Your form will be opened in design view." But the thing is i do have other users but no one even had the database open and i didn't have any other windows for access open. so then when i tried to open it in Form view i got this message "Syntax error in FROM claus". Can someone please tell me what that means and possibly what is wrong? :( :confused: :(

View 1 Replies View Related

Syntax Error Problem

Oct 19, 2004

Dim mysql

mysql = "insert into [OwnerOccupierDetails] (owner_no,owner_name,owner_address,owner_phone,own er_confirmation,owner_reps,owner_reps_planner,owne r_herd_no,owner_area_status,owner_date,owner_detai ls,occupier_no,occupier_name," & _
"occupier_address,occupier_phone,occupier_confirmat ion,occupier_reps,occupier_reps_planner,occupier_h erd_no,occupier_area_ status,occupier_date,occupier_details,source_name, details) VALUES ('" & _
Me.[txtownerNo] & "','" & Me.[txtownerName] & "','" & Me.[txtownerAddress] & "','" & Me.[txtownerNumber] & "','" & Me.[cboownerConfirmation] & "','" & Me.[cboownerReps] & "','" & _
Me.[txtownerRepsplanner] & "','" & Me.[txtOwnerHerdNo] & "','" & Me.[cboOwnerAreaStatus] & "','" & Me.[txtOwnerDate] & "','" & Me.[txtOwnerDetails] & "','" & _
Me.[txtoccupierNo] & "','" & Me.[txtoccupierName] & "','" & Me.[txtoccupierAddress] & "','" & Me.[txtoccupierNumber] & "','" & Me.[cbooccupierConfirmation] & "','" & Me.[cboOccupierReps] & "','" & Me.[txtOccupierRepsPlanner] & "','" & Me.[txtOccupierHerdNo] & "','" & Me.[cboOccupierAreaStatus] & "','" & Me.[txtOccupierDate] & "','" & Me.[txtOccupierDetails] & "','" & Me.[txtSourceName] & "','" & Me.[txtdetails] & "');"

DoCmd.RunSQL mysql


im getting a runtime error '3134' syntax error in insert into statement but i cant see the problem. could anyone else spot it?

View 3 Replies View Related

Syntax Error In Date

Jun 21, 2005

when i want to update this form i get the the next error:
2147217913
Syntax error in date in query expression ##

Wat does that means?

Code:<html><body><h2>RMA Aanvraag Bewerken</h2><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("db/login.mdb"))cid=Request.Form("rmanummer")if Request.form("klacht")="" then set rs=Server.CreateObject("ADODB.Recordset") rs.open "SELECT * FROM rma WHERE rmanummer=" & cid & "",conn %> <form method="post" action="RmaBewerken.asp"> <table> <%for each x in rs.Fields%> <tr> <td><%=x.name%></td> <td><input name="<%=x.name%>" value="<%=x.value%>"></td> <%next%> </tr> </table> <br /><br /> <input type="submit" value="RMA Bijwerken"> </form><%else sql="UPDATE rma SET " sql=sql & "product='" & Request.Form("product") & "'," sql=sql & "klacht='" & Request.Form("klacht") & "'," sql=sql & "serienummer='" & Request.Form("serienummer") & "'," sql=sql & "[Datum melding]=#" & Request.Form("datum melding") & "#," sql=sql & "[Datum binnen]=#" & Request.Form("datum binnen") & "#," sql=sql & "[Datum Gereed]=#" & Request.Form("datum gereed") & "#," sql=sql & "opmerkingen='" & Request.Form("opmerkingen") & "'," sql=sql & "status='" & Request.Form("status") & "'," sql=sql & "oplossing='" & Request.Form("oplossing") & "'," sql=sql & "username='" & Request.Form("username") & "'" sql=sql & " WHERE rmanummer=" & cid & "" on error resume next conn.Execute sql If Err.number <> 0 then 'if there is an error response.write ("Sorry you have encoutered an error." & "<br>")response.write ("Your error number is " & Err.number & "<br>")response.write ("The error source is " & Err.source & "<br>") response.write ("The error description is " & Err.description & "<br>")response.write ("The error line is " & Err.line & "<br>") else response.write("RMA aanvraag " & cid & " is bijgewerkt!")End If end ifconn.close%></body>&nbsp;</html>

View 1 Replies View Related

Syntax Error In FROM Clause.. Why?

Jun 20, 2005

Hi I realised something adnormal about my asp program..hope someone can advise me on this

When I just to connect to my access DB using Microsoft's access driver(dsn approach), the program run fine and I can access all my tables correctly.

However now when I'm using OLEDB connection to connect instead, I encounter the problem of my program only being able to connect to certain tables in the DB only. The error msg that i received is as shown in the title :
"Syntax error in FROM clause"


I have list my connection string and code below, pls go on reading if you can help me.. thanks a lot !

The code below is my connection string:
<---------------------------------------------
Set cn = CreateObject("ADODB.Connection")

cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Properties("Data Source") = Server.Mappath("database/backup_20june/LiansengDB.mdb")
cn.Properties("Jet OLEDBatabase Password") = "P@55word"
cn.Open
................................................

and this is my code to access the tables

<--------------------------------------------
Dim RSlogin
Dim RSlogin_numRows
Set RSlogin = Server.CreateObject("ADODB.Recordset")
RSlogin.ActiveConnection = cn
RSlogin.open("SELECT * FROM User")
.................................................

strangely this code will give me error but if i access another table instead e.g "SELECT Name FROM Products ORDER BY Name ASC", there won't be any error at all...
I 'm really puzzled... any help will be appreciated!

View 3 Replies View Related

Error In Querry Syntax!!

Oct 6, 2006

What is the problem with this syntax..??

LSQL = "insert into processus 'txt_id.Value', libelle = 'txt_libelle.Value', version='txt_version.value',type='cmb_type.value' ,cle_tri='txt_cle_tri.value' "

All fields except for cle_tri are alphanumeric..

View 2 Replies View Related

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







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