Re: Data Reports in VB6

  • 13 years ago

    Dim SQL As String

    Dim Conn as Adodb.connection

    Dim rs as Adodb.recordset 

    Dim strConnect As String

    SQL = "select * from TABLE_NAME where item_code = 'helmet'"

    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test.MDB;Persist Security Info=False"

        Set conn = New ADODB.Connection
        conn.CursorLocation = adUseClient
        conn.CommandTimeout = 0
        conn.Open (strConnect)
       
        Set rsQ = New ADODB.Recordset

        rsQ.CursorLocation = adUseClient
        rsQ.CursorType = adOpenStatic
        rsQ.Source = SQL
        rsQ.ActiveConnection = conn
        rsQ.Open

     

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila” - Mitch Ratcliffe