Solved

SQL Database...

Posted on 2000-03-07
7
157 Views
Last Modified: 2013-11-23
I have an application I'm working on that uses an MS SQL 7.0 database. This application will installed on many machines.  What I would like to know is if there is a way to not have to use the Enterprise Manager to re-create the database on those machines after the softwares installed.  I would prefer to just include the database with the install, even though I'll still need to set the permissions.  Is there any easy way of doing this?
0
Comment
Question by:dokken
7 Comments
 
LVL 2

Expert Comment

by:kubeerja
Comment Utility
an easy way is to generate a full script of your DataBase and make your application run this script once installed to create the Database and other Database objects.
0
 
LVL 1

Expert Comment

by:yk030299
Comment Utility
since all client can connect to the same DBMS server, so I think re-creating database manytimes is not necessary. you just need to create database by sa and grant premessions to all users who need this db.
As Kubeerja said, you can make a script if you still want to re-do anything.
0
 
LVL 1

Expert Comment

by:chengjian
Comment Utility
In enterprise manager, click the database you need, and click Generate SQL Script, and in option tab, check all options. Now, not only use script all database object but also the permissions.

To give permission to roll instead of single user, so, what you want to do after installation is add user to roll not give specified user permissions.

if all servers is online, what you need perhaps is a DTS Import/Export

good luc
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:dokken
Comment Utility
Doesn't sound like there's any easy way.  The program will be installed on machines at locations which aren't hooked up to any network so they will require their own database.  Since there will be many people installing the software I had wanted to make this part of it as easy as possible.  How do shareware authors include a MS SQL database?
0
 

Expert Comment

by:Chelly_the_dog
Comment Utility
Why do you use a MS SQL Database ?
If i understand you correctly you have written a Single user application, that does not need a Client/Server-Database.
Nevertheless, if you want to use MS SQL and you can make it sure, that MS SQL ist installed correctly on the local machine, you can connect within your application and execute the script after you have installed the BDE or a direct access driver.
You can also include this part in your installation program if you do not want your application to do this on first startup. InstallShield can handle this for you !
0
 

Accepted Solution

by:
johnstoned earned 150 total points
Comment Utility
I would consider converting the program to use MS Access or Paradox tables.  You can then include a blank database with the distrabution and it will just work.  There is no need to even have a database engine installed, as the BDE will work with these types of database as standard.

If you are still determined to use SQL Server, you can do this...

Create a registry setting in HKEY_Local_Machine so that you can tell if your program is running for the first time or not.  If it is, run an SQL statement like..

create database MyDatabase
(name = MyDBData,
 filename = 'c:\mssql7\mydb.mdf',
 size=20mb,
 filegrowth = 10mb)
log on
(name = MyDBLog,
 FileName = 'c:\mssql7\mydb.ldf',
 size = 5mb,
 filegrowth = 1mb)

Executing that will create a new database.
You can then use create table to add tables to the database from within Delphi.

Hope that's of some use,
Dave.
0
 

Author Comment

by:dokken
Comment Utility
The program is going to be a multi-user program and the data needs to be searchable on the web.  This is why I wanted to use MS SQL.  Unfortunately, after converting my application over to using it, it's way too slow.  I think the problem is ODBC, which is the only way I connect to it with the Delphi Professional, right?

I'll give the points to anyone who can answer this for me... I need a database, which doesn't have the 2 gig size limitation, and preferably the machine it's installed on (it won't always be through a network) doesn't need anything special to use it. And connecting to it through ODBC is not an options since it seems to really slow things down.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now