🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #15528

Re: visual basic problem.....

#15528
From: Development
Date: Thu, 21 Sep 2000 00:00
42 lines
1937 bytes
Please don't bother 29 newsgroups with one question....certainly if they
haven't got anything to do with it...

Your Set instruction for the database opbject should be branched:
If IsMissing(DbPassword) Then (what you already have) Else (supply the pwd as
stated in the MS Help files examples on the Database object).

Waldo Smets
SoftwareSuite�
Heverlee- Leuven


The_firm wrote:

> Problems with the dbpassword..... what if I have a password how do I
> connect?
>
> Public Function AddTable(DbName As String, DbPath As String, TableName As
> String, Optional DbPassword As String)
>
> If FileExists(DbPath & "\" & DbName & ".mdb") = True Then
>     On Error GoTo ErrorHandler
>
>         Dim MyDatabase As Database
>         Dim MyTableDef As TableDef, MyField As Field
>
>             Set MyDatabase = Workspaces(0).OpenDatabase(DbPath & "\" &
> DbName & ".MDB")
>             Set MyTableDef = MyDatabase.CreateTableDef(TableName)
>
> Else
>
>         Call MsgBox("Database doesn't exists:" & Chr(13) & UCase(DbPath) &
> "\" & _
>         UCase(DbName) & ".MDB", vbCritical, "Dbase")
>
> End If
>
> ErrorHandler:
>
> MyDatabase.Close
> End Function
Technical Details
Message-ID: <39CAA053.9E18FE03@softwaresuite.be>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39ca988e$0$4492$73bec57d@news.be.uu.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fcea4,d0023abb079555b7,start
X-Google-Attributes: gidfcea4,public
From: "Development@SoftwareSuite.be" <development@softwaresuite.be>
Subject: Re: visual basic problem.....
Date: 2000/09/21
Message-ID: <39CAA053.9E18FE03@softwaresuite.be>
X-Deja-AN: 672682867
Content-Transfer-Encoding: 8bit
References: <39ca988e$0$4492$73bec57d@news.be.uu.net>
X-Accept-Language: en
Content-Type: text/plain; charset=iso-8859-1
X-Complaints-To: abuse@chello.be
X-Trace: news.chello.be 969580646 195.162.216.140 (Fri, 22 Sep 2000 01:57:26 MET DST)
Organization: Chello Usenet Service
MIME-Version: 1.0
NNTP-Posting-Date: Fri, 22 Sep 2000 01:57:26 MET DST
Newsgroups: be.comp.programming