Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    3

    Unanswered: createuser question

    Hi
    Trying to build a command line createuser for use in a VB.Net app
    The line below attempts to add user testname

    CREATEUSER -D -A -e -l -S -R -h localhost -U postgre testname

    Works fine except it prompts form password for user postgre, is there anyway of including the password in the command line?

  2. #2
    Join Date
    Jun 2006
    Posts
    3
    Or to put it another way -
    Can anyone point me towards a good example of -
    Using VB.Net, creating a install which will do the following without the end user having to type in passwords
    1. Install PostGreSQL
    2. create a user, not superuser but able to login
    3. create a database

    Thanks in advance

  3. #3
    Join Date
    Jun 2006
    Posts
    3

    Got it

    Code:
    Public Sub CreateUser()
            Try
                Dim strSQL As String = "CREATE USER USER2 WITH PASSWORD 'USER2'"
                Dim cn As OdbcConnection
                cn = New OdbcConnection(db.conString1)
                cn.Open()
                Dim cmd As New OdbcCommand(strSQL, cn)
                cmd.CommandType = CommandType.Text
                cmd.ExecuteNonQuery()
            Catch
                MessageBox.Show("Error Creating DB")
            End Try
        End Sub
    Last edited by loquin; 06-07-06 at 21:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •