Results 1 to 2 of 2

Thread: Comparing with a database?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Posts
    79

    Resolved Comparing with a database?

    Hi there i have written this connection string (with allot of help as im very new to VB)

    Option Explicit
    Private WithEvents connConnection As ADODB.Connection
    Private WithEvents rsRecordSet As ADODB.Recordset
    Dim mblnAddMode As Boolean
    Private Sub create_user_Click()
    Dim strConnect As String
    Dim strProvider As String
    Dim strDataSource As String
    Dim strDataBaseName As String

    strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"
    strDataSource = App.Path
    strDataBaseName = "\clockDB.mdb;"
    strDataSource = "Data Source=" & strDataSource & _
    strDataBaseName
    strConnect = strProvider & strDataSource
    Set connConnection = New ADODB.Connection

    connConnection.CursorLocation = adUseClient
    connConnection.Open strConnect

    Set rsRecordSet = New ADODB.Recordset
    rsRecordSet.CursorType = adOpenStatic
    rsRecordSet.CursorLocation = adUseClient
    rsRecordSet.LockType = adLockPessimistic
    rsRecordSet.Source = "Select * From users"

    rsRecordSet.ActiveConnection = connConnection
    rsRecordSet.Open
    Label6.Caption = strConnect
    End Sub

    i need in the same cmd button routine to check whether the value of the field new_user.text = any of records in the username column of the users table in my database. (basically checking to see whether the username exists before it can create the new user)

    any help would be greatly appreciated
    Last edited by golyath; Feb 2nd, 2005 at 02:18 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width