Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21168

having problems with database in VB6

$
0
0
Hello all,

I have a problem to set a variabel for a recordset.
The connection to the database was set by our IT manager so if any extra info is needed for that just let me know and i will ask it.

So here is the problem:
Below is the connection in the form load. It is not causing any problems
Code:

Dta.ECD.ConnectionString = "Provider=*****;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ECD;Data Source=" + wDataSource
Dta.ECD.Open

On the form there is a combobox. I want to fill in a flexgrid filled with data out of my database. However every option in the combobox has another query. So now i dont want to repeat the code for filling in the flexgrid. I thought it would be easy like below but it doesn't work

Code:

dim rst as recordset 'what is the difference between recordset or recordsets?

if combobox.listindex = 0 then
    set rst as dta.rssp_firstquery
elseif combobox.listindex = 1 then
    set rst = dta.rssp_secondquery
end if
with rst
  bunch of code to fill the flexgrid
end with

So the problem is with the
Code:

set rst =  dta.rssp_firstquery
The rssp_query's are already predefind in the database itself and imported to VB6

Hope all is clear else let me know and i will provide the info.

Viewing all articles
Browse latest Browse all 21168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>