VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 300,513 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,944 people online right now. Registration is fast and FREE... Join Now!




I can't open my database.

 

I can't open my database.

pspb

4 Jan, 2009 - 06:14 PM
Post #1

New D.I.C Head
*

Joined: 4 Jan, 2009
Posts: 1

CODE
Private Sub cmdLogIn_Click()
Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.Open CNDetails


With RS
    .Open "SELECT COUNT(*) As howmany FROM Manager WHERE Username=!" & txtusername.Text & "'", CN, adOpenDynamic, adLockOptimistic
Dim RCount As Integer
        RCount = !howmany
        If RCount >= 1 Then
        .Close
        .Open "SELECT * FROM Manager Where Username='" & txtusername.Text & "'", CN, adOpenDynamic, adLockOptimistic
Dim pass As String
        pass = !Password
        If pass = txtpassword.Text Then
            MsgBox "Go ahead", vbExclamation, "Message"
        Else
            MsgBox "Access Denied", vbCritical, "Unknown User"
        End If
        Else
            MsgBox "No record found." & txtusername.Text & "'", vbCritical, "Unknown user"
      
        Exit Sub
        
Load frmmenu
frmmenu.Show
Unload Me
End If
End With

If txtpassword.Text = "" Then
               MsgBox "provide your password!!!", vbCritical
            
            
Else
               UserName = "san pablo"
               Password = "bakeshop"

      If txtusername = UserName And txtpassword = Password Then
          MsgBox "Welcome to Panaderia San Pablo Bakeshop", vbExclamation
             Load frmmenu
             frmmenu.Show
             Unload frmSS
            
       Else
          MsgBox "Access Denied", vbCritical
          txtpassword.SetFocus
          
       End If
      
           End If
End Sub


User is offlineProfile CardPM
+Quote Post


n8wxs

RE: I Can't Open My Database.

4 Jan, 2009 - 06:17 PM
Post #2

--... ...-- -.. . -. ---.. .-- -..- ...
Group Icon

Joined: 6 Jan, 2008
Posts: 1,609



Thanked: 230 times
My Contributions
Welcome!

Please post your code examples using tags:

code.gif

You can edit your post to add the code tags.

This post has been edited by n8wxs: 4 Jan, 2009 - 06:18 PM
User is offlineProfile CardPM
+Quote Post

Jayman

RE: I Can't Open My Database.

5 Jan, 2009 - 10:12 AM
Post #3

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 8,544



Thanked: 226 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Are you getting any error messages?

Describe in detail exactly what is not working when you try to connect to your database.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 05:15AM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month