I am very much a novice and would greatly value any input on this issue. I had written a function which was an absolute parallel construction to the one listed below, but this one keeps giving me 'two few parameters. Expected 2' error in the immediate window. I have looked very carefully at the WHERE statement in the immediate window (debugging) and I cannot see any error. With further debugging attempts, it keeps sending me to this line: Set rt = dc.OpenRecordset(strsqli). Here is the complete code for the function: - Function arrears(longID As Long, strID As String)
-
-
-
-
Dim rt As DAO.Recordset
-
Dim startArrears As Currency
-
Dim dc As DAO.Database
-
Dim strsqli As String
-
-
Set dc = CurrentDb
-
-
-
strsqli = "SELECT tlbstartArrears.personID, tlbstartArrears.unitID, tlbstartArrears.startBalance AS starting " & _
-
"FROM tlbstartArrears " & _
-
"WHERE (((tblstartArrears.personID)=" & longID & ")" & "AND" & "((tblstartArrears.strID)='" & strID & "'" & "));"
-
-
Set rt = dc.OpenRecordset(strsqli)
-
startArrears = rt!starting
-
-
arrears = startArrears
-
-
rt.Close
-
dc.Close
-
Set rt = Nothing
-
Set dc = Nothing
I have a feeling that the bang operator is not being used correctly. The sql string is just about identical in form the other function where it works perfectly. I am not experienced enough with recordsets to quite figure this one out. Please help!
First, please use the Code tags when posting code, so it is easier for us to follow.
Second, right before the line that gives you the error, insert:
Then post what is listed int he immediate window. This will help us debug what is wrong with your string.
However, one problem might be iwth your "AND"
It should probably be:
Note the spaces around the keyword.
4 992
First, please use the Code tags when posting code, so it is easier for us to follow.
Second, right before the line that gives you the error, insert:
Then post what is listed int he immediate window. This will help us debug what is wrong with your string.
However, one problem might be iwth your "AND"
It should probably be:
Note the spaces around the keyword.
To twinnyfo,
I really appreciate input on this issue; I think that I did figure this one out! I am not sure how to use code tags feature. I presume it is the [code/] button. I will try it out.
Thank you zmbd and others; this is finally coming along better. I am sure that from a design point of view, this database project is crude compared to those of professional developers, but it manages to do the trick so far.Seem to be getting the hang of sql syntax also. Evidently, a fair number of 'novices' are trying there hand at writing a database and injecting code for more customized performance.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Thomas Scheiderich |
last post by:
Why would you use the Recordset object over the Execute method of
getting data from your Sql database.
For example, I have the following:
Execute Method...
|
by: Tom |
last post by:
I want to open a recordset object on an .asp page. When I open the
recordset I would like to use a stored procedure that expects a parameter to
be passed for the stored procedure. I will then use...
|
by: gman997 |
last post by:
Hi all,
At a high level here is what is going on -- I built a C# COM object. I need to call this com object from SQL Server using the sp_OACreate stored procedure in SQL Server. I build the COM...
|
by: JingleBEV |
last post by:
Hi all,
I am trying not to use global variable to maintain data consistency. Some
procedures and functions will require to pass the recordset object for
processing and functions may also return...
|
by: Bala A |
last post by:
I have an ActiveX EXE. One of the methods in this component has
"Recordset Object" as input parameter which has to be passed by
reference. I have to call this method from C# code.
From C#, how...
|
by: rob |
last post by:
Dear All,
I have a COM+ component that returns an ADODB.Recordset. In an include file
that is included by an aspx page I assign that returned recorset to an
ADODB._Recordset. Unfortunately, this...
|
by: munusoni |
last post by:
Hi everyone,
i am using ASP 3.0 to create web pages for a college project and i am
having problems in using recordset object through session object to
pass data to all web pages.Anyone tell me how...
|
by: ADezii |
last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be:
Can I add New Records to the...
|
by: reginaldmerritt |
last post by:
When opeing and closing a DAO recordset a few times i get the following error message:
I've been google and forum investigating all day. The only thing i have found is information on...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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: 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,...
|
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...
|
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...
|
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...
|
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,...
| |