Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VBA ADO Major error

This was supposedly sent on Friday, but I didn't see it..

"Peter Lux" wrote in message news:...
I've been looking at this all day and I'm about ready to scream.
I have a form in Excel 2003 that pulls data from Access 2003. I'm using
ADO and can connect to the database, no problem. The problem is the data
fetch is WRONG. (Like "buggy" wrong):

Let's say I have a table with 3 character (text) fields in them, column1
is 10chars wide, column2 is 15 chars, column3 is 3 wide
Now data looks like:
column1 column2 column3
foo boodle drr
and in Excel I do
Dim cAcc As New ADODB.Connection
Dim rsAcc As New ADODB.Recordset
Dim cx as String
cx = "DSN=nudbodbc;user=sa"
cAcc.Open cx
Set rsAcc = cAcc.Execute(" Select column1, column2, column3 from table1")
TextBox1.Text = rsAcc(0)
TextBox2.Text = rsAcc(1)
TextBox3.Text = rsAcc(2)

'This is where it's WRONG'
Right from the immediate window in VBA:
rsAcc(0):
foo 
rsAcc(1):
boodle  dr (WTF?! should be just 'boodle' and yes the [] things show
in the text box)
rsAcc(2):
dr (Again WTF? it should be 'drr')

It looks like it grabs the field length and fills in with whatever data it
has REGARDLESS of which column it came from. That's a major error if you
ask me.

I've duplicated this in more than one database, so I know it's not the sid
that's the problem. I've dropped and recreated the table so that's not it.
I've also tried various itterations of rsAcc.Fields(i) and
rsAcc.Fields.Item(i) and get the same result both times. I've tried other
tables, "fetch everything" statements. It seems NOT to affect numeric
columns though. (WTF?!)
Is this a service pak issue? Has anyone else seen this buggy behaviour.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Major Help on the Macro bioyyy Excel Discussion (Misc queries) 12 October 25th 08 11:43 AM
Need some major help mdefee Excel Discussion (Misc queries) 1 January 18th 07 02:22 AM
VBA ADO Major error Peter Lux Excel Programming 1 March 31st 06 11:38 PM
I need major help fast!!!!! Mr. Jay Excel Discussion (Misc queries) 3 March 10th 06 04:22 PM
Major help needed mike_vr Excel Discussion (Misc queries) 6 April 19th 05 12:31 PM


All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"