Re: Please Help Me in Visual Basic 6.0 SP6



Public Sub setdbpswd()
Dim dbPath As String
Dim dbConn As String

dbPath = App.Path & "\database\jheks" & "\pswdjheks.mde"
dbConn = "provider=Microsoft.Jet.OLEDB.4.0;data source=" & dbPath &
";Jet OLEDB:database password ="
dbpswd.ConnectionString = dbConn
dbpswd.CursorLocation = adUseClient
dbpswd.CommandTimeout = 30
dbpswd.Open
End Sub
------------------------------------------------------------------------------------

Above is my programming where in this programming, we indicate that where
the database location using App Path. But, using this same programming or
others, how can i indicate myself which one i'm gonna insert to the database.
It's seems like to have an input first before we can establish the connection
to the particular database chosen.

The case is like this, I will have the path like "\database1\jheks",
"\database\jheks", \database2\jheks" and so on. The case and the problem is,
i want my user to indicate which database folder they refer to insert, and
then my application will connect to it. But I don't know how to done that.
For your infomation, this folder "\database" will refer to which batch of
file will gonna insert to the database.

I've information where to select the database is using listbox/combobox, or
also can using Windows Common Dialog. But, how to hold the selection and
where to put it? Any tutorial that can help me?

Thanks in advance.

"Paul Clement" wrote:

> On Wed, 3 Aug 2005 20:51:51 -0700, d_harry45 <mfmz78@xxxxxxxxxxx> wrote:
>
> ¤ i'm not meant to ask for a free service here..but i am searching for a
> ¤ solution where as somebody can help me where to start. Because, in this case,
> ¤ i've no idea on how to start it. Is it using Connectionless or others.
> ¤
> ¤ My opinion is, how to make the connection string to the database as a
> ¤ variable? Because this is when the user select the database from combobox or
> ¤ listbox, so the selected database file will be the string to make the
> ¤ application to connect to. Because, I just know we can hard code it in our
> ¤ programming, but i don't want that.
> ¤
> ¤ Any suggestion? Many thanks in advance.
>
> You could use the SaveSetting and GetSetting functions to store part of your connection string in
> the Registry.
>
> Maybe you could indicate where you are stuck so that we can answer specific questions.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>
.



Relevant Pages

  • Re: Invalid variant type conversion
    ... because within regular programming, there would be no agreement upon what ... applications built by standard Delphi controls, ... NULL is the same as "" in a database. ... >> The empty string tells it all. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Register Database to ODBC DSN Database by VB program
    ... ¤ Hello all! ... I need register my Database to ODBC DSN Database by VB programm ... If I understand your question you want to create an ODBC DSN for an Access database: ... ByVal lpszDriver As String, ...
    (microsoft.public.vb.database)
  • Re: Connection question
    ... recordset using the connection, the record count property was -1. ... How do I specify the cursor location propery in the connection string? ... > ¤ Hello, ... The object being that I want the connection to fail if the database is ...
    (microsoft.public.vb.database.ado)
  • Re: An easy one - db path at design time problem.
    ... > I'm not good at programming or databases and I'm still having trouble. ... > I declared a variable in a module, to hold the path to the database ... > Public myDB As String ... Now you have a string containing the actual path to the ...
    (microsoft.public.vb.database)
  • Re: Compact and Repair
    ... ¤ Hi ... Public Function CompactDB(pFileName As String) As Boolean ... If your source database has a database password then you should use the following: ...
    (microsoft.public.vb.database.ado)