473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get data from an existing query in access using VB5 ?

Hi all.

I have a database (agenda.mdb) with a table called "movimentacoes"

In access I created a query named "RESULATODTAB" wich is a cross-tab query.

I want my program to check that query and return all the results from it to a list in visual basic called lstresultados.

What I have so far is a code to run the query(thanks Paul):

Dim strConnectionString As String
Dim objConn As ADODB.Connection
Dim objCommand As ADODB.Command

strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=f:\visual basic meus programas\nova pasta\agenda.mdb;" & _
"Jet OLEDB:Engine Type=4"

Set objConn = New ADODB.Connection
objConn.Open strConnectionString

Set objCommand = New ADODB.Command

objCommand.ActiveConnection = objConn

' Assign to ADO Command object
objCommand.CommandText = "resultaodtab"
objCommand.CommandType = adCmdStoredProc

objCommand.Execute

objConn.Close

Set objCommand = Nothing
Set objConn = Nothing

Can anyone please help me ?
Sep 10 '10 #1
0 857

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

Similar topics

7
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to...
0
by: Andrew Chanter | last post by:
I have created an ADP connected to a SQL Server database. When I configured the connection to the db originally, all tables in the db came thru as linked tables in the ADP. However when I now...
0
by: rajabide4u | last post by:
How to insert data into ms access using javascript
2
Arun Raj
by: Arun Raj | last post by:
hi every body i am a newbie, i am not able to get data from MEMO field (MS Access) using query in VB. in my memo field i have inserted data line by line. at vb run time when i enter a...
2
by: muralin | last post by:
Please tell me how can I get the data from MS Access using perl script and that data I need to export into excel automatically using perl. Please post some sample code. Thanks In Advance!
3
by: najmi | last post by:
this is my coding..when i run this coding, it give me an error Microsoft JET Database Engine (0x80040E07) Data type mismatch in criteria expression. anybody can help me <head> <meta...
23
by: najmi | last post by:
this my coding.. <% dim cintid cintid = request.form("txtid") dim objconn set objconn = server.createobject("ADODB.connection") objconn.provider = "Microsoft.Jet.OLEDB.4.0"...
1
by: tamoochin | last post by:
I have a form that registers the user with my website, the form is in farsi language and must use utf-8 standard. I can store data in MS Access and also read it back with any problems. the...
1
by: Rocker1 | last post by:
Hello guys, I am reading a downloaded textfile which has a fields like date,NAV and Name using VB.NET. The date on which the textfile is downloaded remains the same.After each readline operation...
3
by: lord lolipop | last post by:
i'm trying to extract data from ms access using excel's vba .. i;m using combo box to select ..like for an example in my combo box there's GSM and PDA .. then when i select GSM then information will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.