Time to transfer data in EasyHID


Results 1 to 21 of 21

Threaded View

  1. #11
    Join Date
    Feb 2003
    Posts
    432

    Default

    Quote Originally Posted by Demon
    I put the code when I load the form, is that ok?

    Private Sub Form_Load()
    Dim adoConn As New ADODB.Connection
    Dim adoRS As New ADODB.Recordset

    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    strConn = strConn & "E:\EasyHID\Xk1 v2\USBProject\VisualBASIC\Modified code\NR2003.mdb"
    adoConn.ConnectionString = strConn
    adoConn.Open
    End Sub

    Or should I make another subroutine for this?

    Robert
    Thats exactly where I put it !

    Code:
    Private Sub Form_Load()
        strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
        strConn = strConn & "K:\HTML\db\KAT5AV.mdb"
        adoConn.ConnectionString = strConn
        adoConn.Open
        MSComm1.CommPort = 3
        If MSComm1.PortOpen = False Then MSComm1.PortOpen = True
    End Sub
    Having said that, the one big difference I see is that you declare your adoConn and adoRS within the subroutine therefore they are not global variables and once you leave Form_Load they arent accessable.

    Mine are declared in General Declarations.
    Last edited by Demon; - 4th October 2016 at 16:57.
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Nokia 3310 display text
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th August 2007, 03:39
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts