Re: ISAM

From: Max Smart <msmart86_at_OUTmindspring.com>
Date: 2000/07/27
Message-ID: <8lp45p$uet$1_at_slb3.atl.mindspring.net>#1/1


Colin:

I stumbled across the solution at an MS website. Thanks for responding.

Max

Module level variables...
mstrDBPath = App.Path & "\MyDB.mdb"
mstrPASSWORD = "MyPassword"

Private Sub SetPubConn()

  Dim strConn         As String
  Dim strSQL          As String

  strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

    "Persist Security Info=True;" & _
    "Data Source=" & mstrDBPath & _
    ";Jet OLEDB:Database Password=" & mstrPASSWORD & _
    ";Mode=Read|Write"

  strSQL = "SELECT * FROM Pubs ORDER BY PubName"

  With adoPubList ' ADODC data control

    .ConnectionString = strConn
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
    .CommandType = adCmdText
    .RecordSource = strSQL
    .Refresh

  End With
End Sub

Colin Gourlay <cgourlay_at_freenetname.co.uk> wrote in message news:8lk750$8ks$1_at_gxsn.com...
> Max,
>
> I have pasted your code into my IDE and I also receive the message you
 refer
> to - regardless of whether I put a password on the dbase.
>
> You obvioulsy have additional code (the use of mstrDBPath suggests
 this) so
> the following may/may not point you in the right direction.
>
> To communicate with your dbase you need to set up the connection
 string,
> open the database and then generate your recordset - the code segment
 you
> have provided appears to omit opening the dbase (I suspect, that this
 is
> causing the error).
>
> The code below shows how you can open (using VB6.0 Service Pack 4, Win
 98)
> the dbase, query it and pass the resultant recordset to the debug
 window.
>
> Hope this helps
>
> Regards
>
> Colin Gourlay
> CG Systems
> http://www.cgsystems.org.uk
>
>
> Dim adoConnection As New ADODB.Connection
> Dim adoRecordset As New ADODB.Recordset
> Dim strConnectionString As String
>
> strConnectionString = Adodc1.ConnectionString
> adoConnection.Open strConnectionString
> adoRecordset.Open "SELECT * FROM tblCustomer ORDER BY txtSurname",
> adoConnection
> Debug.Print rst.Fields("txtSurname")
>
>
> Max Smart <msmart86_at_OUTmindspring.com> wrote in message
> news:8l03bt$tmj$1_at_slb6.atl.mindspring.net...
> > I'm using a VB6 front-end with an Access 97 database using an ADO
> > DataControl to connect to the DB. Everything is fine until I try to
 add
> > a password to the database - ADO error message says 'Couldn't find
> > installable ISAM' (no error number). I haven't been able to locate
 any
> > help in the Help files. Do I need to set a reference to something?
> >
> > Thanks,
> > Max
> >
> >
> > With adoArticle
> > .ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
> > "Persist Security Info=False;Data Source=" & mstrDBPath & _
> > "; pwd=test; Mode=Read|Write"
> > .CursorLocation = adUseClient
> > .CursorType = adOpenStatic
> > .CommandType = adCmdText
> > .RecordSource = "SELECT * FROM Articles Order By Title"
> > .Refresh
> > End With
> >
> >
>
>
Received on Thu Jul 27 2000 - 00:00:00 CEST

Original text of this message