ADO problems - open recordset

SIN

New member
Local time
Today, 06:08
Joined
May 20, 2016
Messages
4
Hi,

I am new in access VBA (I have some experience in excel VBA).

What is wrong with the following code - does not shown/open mySQL in access as datasheet view/ query? :banghead: Also, does not report any error? What to do? Thanks in advance!



Public Sub Probna()

Dim mySQL As String

Dim cnnX As ADODB.Connection
Set cnnX = CurrentProject.Connection

Dim myRecordSet As New ADODB.Recordset
myRecordSet.ActiveConnection = cnnX


mySQL = "SELECT [Retail portfolio database prije].JMBG"
mySQL = mySQL + " FROM [Retail portfolio database prije];"

myRecordSet.Open mySQL

End Sub
 
A recordset is just in memory, nothing will show on screen. Add this at the end:

MsgBox myRecordSet!JMBG

And see if it displays a value.

FYI, I moved your thread out of the introductions forum.
 
Thank you very much!
 
No problem, and welcome to the site by the way! Post back if you haven't achieved whatever the end goal was.
 
It is for now, I am learning and at the same time trying to improve business process.

Best
 

Users who are viewing this thread

Back
Top Bottom