home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,057 of 10,840   
   Joe-Paul to All   
   Error -- Not A Valid Password   
   11 May 06 17:47:30   
   
   From: HarvestWind@comcast.net   
      
   Hi:   
      
   I'm using VB 6.0 with an Access 2000 database.  I set the password in the   
   Access database to: abcdef1234.  Then, using a MDIform, during the load   
   event, I send the program to a procedure to get some info out of the   
   database that has been password protected.  I use the following code:   
      
   Public Sub GetSecInfo()   
       Dim secSQL As String, uName As String   
       Dim secRst As DAO.Recordset   
       Dim secDB As DAO.Database   
       Dim secRc As Integer, i As Integer   
      
       Set secDB = OpenDatabase(secPath & "\Setup.mdb", , False,   
   "pwd=jprobb4649")   
      
       My sql goes here.   
      
   Anyway, when the program gets to the "Set secDB" statement, I get an error   
   that says:   
       Error 3031 -- Not a valid password.   
      
   I've tried with and with the "pwd=" and that doesn't make any difference.   
      
   How do I set the password in the database and then open the password   
   protected database?  I've seen it done in other programs using VB 6.0 and   
   Access 2000, but have never seen the code.   
      
   Thanks in advance for any assistance you can give me.   
      
   JP   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca