473,554 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recordset becomes NULL after first read/use

8 New Member
I have Access as FrontEnd and SQL server as Backend. After I call a stored procedure on the SQL server, I try to read the fields in the recordset. However, one of the column can only be used once. After the first use/read, it becomes NULL for no reason.

-----VBA in Access------
strSQL = "EXEC SP_GetDetails '" & strInput & "'"
Set recSQL = ConnSQL.Execute (strSQL)

Do While Not recSQL.EOF
Debug.Print "Customer1 = " & recSQL!Customer
Debug.Print "Customer2 = " & recSQL!Customer
...
Loop

-----Stored Procedure in SQL Server-----
CREATE PROCEDURE SP_GetDetails
@RQFNumInput varchar(20)
As
select Customer From List where Number = @RQFNumInput Order by Date Desc

-----------------------------------------
The problems is the first output gives the value and the second output shows nothing.
Customer1 = My Customer
Customer2 =

This is the same to the following thread. However, there was not answer to it.
http://bytes.com/topic/access/answers/198611-ado-recordset-field-becoming-null

Please help!
Feb 25 '11 #1
3 2715
ck9663
2,878 Recognized Expert Specialist
Execute your SP in a query window and look at the result. It is probably because there is only one record in your table that satisfies your where clause.

Good Luck!!!

~~ CK
Feb 25 '11 #2
hehe panda
8 New Member
I did that and it has two records. The second one's value is NULL though. Will the recordset go to the second record automatically without reaching the row of "recSQL.MoveNex t? I was testing the same row in both debug.print.
Feb 25 '11 #3
ck9663
2,878 Recognized Expert Specialist
It should not. But Access forum will be help you more on that one...

Good Luck!!!

~~ CK
Feb 25 '11 #4

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

Similar topics

6
15422
by: pam | last post by:
sorry for my poor english first. $notation=$rs->fields; if(!empty($notation)) echo $notation; the notation field in database is a text type, when the value is null, it will cause a mistake; i used empty function to check it, but it seems don't take effect.
1
1976
by: Li Pang | last post by:
Hi, I create a web site in a Windows 2003 server/IIS6, and I used asp pages to get ServerVariables. After I set FrontPage Extension 2002, some ServerVariables like LOGON_USER become null. Any body has an idea?
1
3966
by: Annette Massie | last post by:
I have a bunch of images stored in a folder on the harddrive. Is there a way for Access 2000 to read the directory and write a record for the images found? Eventually the records need to be exported to an ASCII, comma delimited file. For example, say there is a folder on C called 1357. Withing 1357 I have images called 0587002, 0587003,...
2
1268
by: Erik | last post by:
Hi All, If I add an object to a hashtable for instance, then further down the line I remove it, do I have to set it to null first before I remove it or does removing it from the collection automatically put it out of scope. Cheers, Erik
1
2823
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the user and has a validator (reDate) attached for specific dates that can be entered. The second date (txtRptDate) is another textbox that is filled...
1
1243
by: rouble | last post by:
Hi All, How do I verify if a field within an ADODB.Recordset is NULL ? I have tried the following two methods that I could think of: 1. If Not IsNothing(rs("fieldname")) Then something = Int32.Parse(rs("fieldname").Value()) End If
4
1707
by: meltedown | last post by:
I have this on a web page <input type='hidden' name ='military' value=1> and this in a javascript function: alert(document.form1.military.value); The military value comes up null.
2
5331
by: PokerMan | last post by:
I have this object o = ds.Tables.Rows.ItemArray; the item read from my dataset is null. I check on the next line : if(o!= null) //then do something My prob is the object o is getting passed that if statement then i crash, in
5
61946
nitindel
by: nitindel | last post by:
Hi All, I am working on ASP VBScript... How can i check the values of a recordset .i.e whether it contains values or not...?? Is NULL considered as a string....?? Actually i want to check on a precondion that if recodset is empty ...i want to take some action if not empty then some other action..
4
1790
kcdoell
by: kcdoell | last post by:
Hello: I am trying to create a DAO record set for the first time. I wanted to keep it simple, so I first wrote something to work for my Division field then I would expand on the code later. Below is what I have in my onClick event: 'Checks to see if there are records for that given Division, Year, Month, Week Combo. 'If so tells the...
0
7535
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...
0
7812
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. ...
0
8051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7574
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...
0
7894
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...
0
6161
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...
1
5442
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3579
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1145
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.