Results 1 to 12 of 12

Thread: [RESOLVED]Deploy .NET 2003 with Database

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Resolved [RESOLVED]Deploy .NET 2003 with Database

    is there a way when installer that i made using .NET 2003 is checking for the Database first, if not exists then make it instead install the app that i made?

    i have a hard time when deploying it with my friend..i made the database manually..it's not a big problem since i only using 3-5 table with less than 15 SPROC..but what about if i develop more

    thanks,
    Last edited by erickwidya; Jan 25th, 2007 at 08:21 PM.

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Deploy .NET 2003 with Database

    I don't understand your question.

    Are you asking if your Installer can create an MS Access Database?

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Deploy .NET 2003 with Database

    Your installation should normally check for each files existence before installing a new one. The installers will check for a previous installagtion not for your database.

    You can however do that with Inno Setup but it is not the default method for installers.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Re: Deploy .NET 2003 with Database

    thx Hack and randem

    Are you asking if your Installer can create an MS Access Database?
    simillar but not with Access, i'm using MSSQL 2000.
    so first the installer is check at the MSSQL wether or not the Database exist, if exista it will prompt user with option to overwrite or keep the existing Database..if doesn't exists then just make the Database with related Table, SPROC,etc that being used for that application

    You can however do that with Inno Setup but it is not the default method for installers.
    i plan to do that with Deployment project in .NET 2003 not using 3rd party installer but if that's the only way to do it then it doesn't matter to me..can u give me some link with the latest version of inno

    thanks

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Deploy .NET 2003 with Database

    In Inno Setup you can do it with the code section. In most installers you can write a seperate program then execute that first to see what you need to do.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Re: Deploy .NET 2003 with Database

    thx randem
    In most installers you can write a seperate program then execute that first to see what you need to do.
    i see..if i can make that program then its gonna be fine..

    when involving with MSSQL then it's best to used SQLDMO to make the program?? or any other thoughts?

    thanks

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Deploy .NET 2003 with Database

    Not really. If you know where the database is and what the name is all you really need to do connect to it. If you cannot then it does not exist or is a not active.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Re: Deploy .NET 2003 with Database

    If you know where the database is and what the name is all you really need to do connect to it. If you cannot then it does not exist or is a not active.
    i will try to do it..

    sorry to bother again,
    i already make the Database, SPROC, Table,etc scripts (used extension .sql) and make it as BatchName.cmd that looks like this when it open it VS.NET IDE
    @echo off
    REM: Command File Created by Microsoft Visual Database Tools
    REM: Date Generated: 22/01/2007
    REM: Authentication type: Windows NT
    REM: Usage: CommandFilename [Server] [Database]

    if '%1' == '' goto usage
    if '%2' == '' goto usage

    if '%1' == '/?' goto usage
    if '%1' == '-?' goto usage
    if '%1' == '?' goto usage
    if '%1' == '/help' goto usage

    osql -S %1 -d %2 -E -b -i "Roles.sql"
    if %ERRORLEVEL% NEQ 0 goto errors
    ... and so on ...

    goto finish

    REM: How to use screen
    :usage
    echo.
    echo Usage: MyScript Server Database
    echo Server: the name of the target SQL Server
    echo Database: the name of the target database
    echo.
    echo Example: MyScript.cmd MainServer MainDatabase
    echo.
    echo.
    goto done

    REM: error handler
    :errors
    echo.
    echo WARNING! Error(s) were detected!
    echo --------------------------------
    echo Please evaluate the situation and, if needed,
    echo restart this command file. You may need to
    echo supply command parameters when executing
    echo this command file.
    echo.
    pause
    goto done

    REM: finished execution
    :finish
    echo.
    echo Script execution is complete!
    :done
    @echo on
    is there a way to execute this file instead code it? or like usual any other idea?

    thanks again

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Deploy .NET 2003 with Database

    Of course you can shell to execute the batch file but why.

    You could just run the command itself from your code and replace the parameters there.
    Code:
    osql -S %1 -d %2 -E -b -i "Roles.sql"

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Re: Deploy .NET 2003 with Database

    run the command?? all i know is running OSQL from the command prompt manually ..

    ok, this will be my homework, will post it if i found any solution

    thanks again randem

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

  11. #11
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [RESOLVED]Deploy .NET 2003 with Database

    Hint: Use the Shell or ShellExecute Command.
    Last edited by randem; Jan 25th, 2007 at 09:32 PM.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Re: [RESOLVED]Deploy .NET 2003 with Database

    ok..i manage to process the Command File (.cmd) that VS.NET 2003 generate in Database Project

    the .cmd when u opened it, it contains this description at above
    @echo off
    REM: Command File Created by Microsoft Visual Database Tools
    REM: Date Generated: 31/01/2007
    REM: Authentication type: Windows NT
    REM: Usage: CommandFilename [Server] [Database]
    ...
    so from that point my guess is when u want to process it u need to make a parameter just like dir command it can have /w, /a as parameter

    and the parameter is save at this line (the line below it)
    ...
    if '%1' == '' goto usage
    if '%2' == '' goto usage
    ...
    if u use SQL Authentication method, it will have 4 parameters

    then i need to 'make' the .cmd know where to look for the script..so i make 3rd variable and use as the script path
    ...
    if '%1' == '' goto usage
    if '%2' == '' goto usage
    if '%3' == '' goto usage
    ...
    osql -S %1 -d %2 -E -b -i "%3Tables\Users\Users.sql"
    if %ERRORLEVEL% NEQ 0 goto errors
    ...
    so when i execute it i need to pass all three parameter using this line
    Code:
    ID = Shell("""C:\myProject\Database\Mycommand.cmd"" localhost myDB C:\myProject\Database\", , True, 100000)
    Quote Originally Posted by from MSDN
    Shell("""C:\Program Files\MyFile.exe"" -a -q", , True, 100000)
    Each pair of adjacent double quotes ("") within the string literal is interpreted as one double quote character in the string. Therefore, the preceding example presents the following string to the Shell function:
    C:\Program Files\MyFile.exe" -a -q

    PS:
    i split each project at separate folder for example
    C:\myProject contains the .sln,
    C:\myProject\Database contains the Database project
    C:\myProject\Database\Tables\ contains the the Table(s) script and also with SPROC script
    and so on..

    don't use '~', space, '-' as a folder name
    Last edited by erickwidya; Jan 31st, 2007 at 11:10 PM.

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

Posting Permissions

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



Click Here to Expand Forum to Full Width