473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ADO assist

I'm trying to create a sales ticket (on a vb form in Excel) and fetching
results from an Access database. When I try to get the results from the
recordset, it doesn't look right. I've re-imported the data with
"trim(<fieldname>)" to make sure that I'm not picking up extra characters.
First, here's the data and how it should look
<the ticket_desc below looks fine>
121
CREEK TWP.
RR4 BOX 334
CLINTON, IL 61727

Here's the code:

Dim cAcc As New ADODB.Connection
Dim rsAcc As New ADODB.Recordset

Private Sub pbPrint_Click()
Dim Line1, Line2, Line3 As String
Dim v1, v2, v3 As String

Set rsAcc = cAcc.Execute(" Select ticket_desc from co_locn")
'This is fine.. it looks good
tbCoLocnAddr.Text = rsAcc(0)
Set rsAcc = cAcc.Execute(" Select a.ticket_nbr, b.name, b.address, b.city,
b.state, b.zip, b.cust_id from Sale a, Customer b where a.ticket_nbr=121 and
" & _
"a.cust_id=b.cust_id and a.address_seq_num = b.address_seq_num")
tbTicket.Text = rsAcc(0)
Line1 = rsAcc.Fields(1)

It didn't matter whether I had rsAcc(1) or rsAcc.Fields(1), line 1 (in
debug) ended up:
CREEK TWP. F RR4 BOX 334
It's the name AND the address..can you not reuse the same recordset or do
you have to 'reset' it before using it again?
Mar 31 '06 #1
1 928
It looks like ADO is fetching 2 columns into one.
"Peter Lux" <pe******@theheritagegrp.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm trying to create a sales ticket (on a vb form in Excel) and fetching
results from an Access database. When I try to get the results from the
recordset, it doesn't look right. I've re-imported the data with
"trim(<fieldname>)" to make sure that I'm not picking up extra characters.
First, here's the data and how it should look
<the ticket_desc below looks fine>
121
CREEK TWP.
RR4 BOX 334
CLINTON, IL 61727

Here's the code:

Dim cAcc As New ADODB.Connection
Dim rsAcc As New ADODB.Recordset

Private Sub pbPrint_Click()
Dim Line1, Line2, Line3 As String
Dim v1, v2, v3 As String

Set rsAcc = cAcc.Execute(" Select ticket_desc from co_locn") 'This is
fine.. it looks good
tbCoLocnAddr.Text = rsAcc(0)
Set rsAcc = cAcc.Execute(" Select a.ticket_nbr, b.name, b.address, b.city,
b.state, b.zip, b.cust_id from Sale a, Customer b where a.ticket_nbr=121
and " & _
"a.cust_id=b.cust_id and a.address_seq_num = b.address_seq_num")
tbTicket.Text = rsAcc(0)
Line1 = rsAcc.Fields(1)

It didn't matter whether I had rsAcc(1) or rsAcc.Fields(1), line 1 (in
debug) ended up:
CREEK TWP. F RR4 BOX 334
It's the name AND the address..can you not reuse the same recordset or do
you have to 'reset' it before using it again?

Mar 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: slaterjas | last post by:
We are running DB2 version 8.1.5. When we execute a query within SQL Assist we are only returned 200 rows. Is there a setting that we can change to increase this?? I can get more results if I...
15
by: Daniel Billingsley | last post by:
Speaking of trying to read deeply nested if-else blocks... I often find it's not always easy to tell one indent level from another (granted I keep my tab settings low so I'm not halfway across...
0
by: Mark Rance | last post by:
I recently bought Visual Assist and was quite disappointed to see how much it slows down the IDE for large solutions. It would also seem to hand the IDE such that I could no longer set focus to...
54
by: MLH | last post by:
I use A97 and do not always insert line numbers while writing procedures. I find it necessary to go back and add them later to aid in debugging. Nearly 3 years ago, something was mentioned in...
1
by: Marcin Balcerzak | last post by:
Hi, Not being an expert in Java (JRE 1.5) or Eclipse (3.1.1) I've encountered an intractable problems. Without apparent reason my Eclipse stopped: 1) Providing me content assist (shows "No...
1
by: Chris | last post by:
Hi, I am working on a small which involves a touchscreen and I need to create a on-screen keyboard. I need some assistance with a few questions 1. For the the buttons, do I user their text as...
1
by: Kelley McNeillie | last post by:
I am contacting you from a company called Software Specialists, an IT Placement Firm based in Pittsburgh, PA. We are prepared to make a donation to your organization if you could please help us out...
0
by: Pastororits | last post by:
Dear Beloved Brethren, Calvary greetings to you all in the name of Our Lord Jesus Christ. I am Pastor Isaac Orits Edah, 36 years old from Lagos Nigeria,married to Evangelist Faith Abosede, We are...
14
by: donovans | last post by:
Hey there, First question: I really need help with debugging this code. I keep getting the java.sql.SQLException: General error, and am now lost at a solution to it...I get this with about 4 of...
0
marktang
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,...
0
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...
0
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,...
1
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...
0
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.