Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / November 2006



Tip: Looking for answers? Try searching our database.

ADO, VB6 and crosstab query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nmxnmx - 24 Nov 2006 19:17 GMT
Hi, well I'm using VB and Access as the db. I have made a crosstab query in
Access and it's work well, but when I do the same in VB through ADO (not the
control) it doesn't work.

I've just copied the SQL sentence as appear in Access to VB as something like:

dim rs as ADODB.Recordset

str_sql = "crosstab query" ' this is the SQL sentence as appear in Access

' conn is a ADODB.Connection already set
Call rs.Open(str_sql, conn, adOpenStatic, adLockOptimistic)
' I've tried with adOpenDynamic too, but I haven't gotten the correct result

When I run that, the result is not that in Access is, the result with ADO
and VB give me only 3 fields -columns- (in Access are about 120 fields), I
mean VB and ADO just show me the fields that in Access are labeled as "row
header" (well I don't know if this label is right because I have the spanish
version of Access and I don't know if this is traslated this way in the
english version), and those fields that are showed by VB are completely empty.

Can not ADO handle crosstab queries? or what am I doing wrong?

Thanks in advanced
Ralph - 25 Nov 2006 14:28 GMT
> Hi, well I'm using VB and Access as the db. I have made a crosstab query in
> Access and it's work well, but when I do the same in VB through ADO (not the
[quoted text clipped - 20 lines]
>
> Thanks in advanced

Warning: Unsatisfactory answer follows... <g>

The short answer is you can't. (*with reservations)
The short warning is you probably don't even want to. CrossTab queries are
not only complex, but extremely resource intensive, and often contain
keywords and instructions only useful to MSAccess, ie, they work well within
a MSAccess app, but grade between a PITA to impossible outside of it.

You might find better success with DAO.

There are 3rd party tools ($$$) which will convert CrossTab queries into
'normal' SQL.

hth
-ralph
Nobody - 27 Nov 2006 17:16 GMT
http://www.sqlteam.com/searchresults.asp?SearchTerms=crosstab&SUBMITs1=Search

> Hi, well I'm using VB and Access as the db. I have made a crosstab query
> in
> Access and it's work well, but when I do the same in VB through ADO (not
> the
> control) it doesn't work.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.