Tuesday, March 27, 2012
Creating a vb6 Custom Install for MSDE 2000
I'm trying to add MSDE to my installation program, and so far have been
unsuccessful. Right now, I'm shelling out the setup.exe program with the
parameters I want, and the install seems to go successfully. However, then I
cannot get that instance of MSDE to start, whether by "net start
instancename" or running sqlservr.exe from the instance's directory, or
running scm.exe from the Tools\Binn directory. Can someone show me the code
they have used to install MSDE along with their apps that works? Thank you
very much in advance for your help.
hi Jason,
"JasonSCC" <JasonSCC@.discussions.microsoft.com> ha scritto nel
messaggio news:AF3F3CDE-FEA0-47E0-B04A-44DE11592A93@.microsoft.com
> Hello,
> I'm trying to add MSDE to my installation program, and so far have
> been unsuccessful. Right now, I'm shelling out the setup.exe program
> with the parameters I want, and the install seems to go successfully.
> However, then I cannot get that instance of MSDE to start, whether by
> "net start instancename" or running sqlservr.exe from the instance's
> directory, or running scm.exe from the Tools\Binn directory. Can
> someone show me the code they have used to install MSDE along with
> their apps that works? Thank you very much in advance for your help.
I install MSDE the very same way you do, but actually I never tried to start
the service my self as I always require a reboot, in order to properly
register all COM components and services registration
after rebooting, the services are available for all my needs..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||On Fri, 7 Jan 2005 06:29:03 -0800, "JasonSCC"
<JasonSCC@.discussions.microsoft.com> wrote:
>Hello,
>I'm trying to add MSDE to my installation program, and so far have been
>unsuccessful. Right now, I'm shelling out the setup.exe program with the
>parameters I want, and the install seems to go successfully. However, then I
>cannot get that instance of MSDE to start, whether by "net start
>instancename" or running sqlservr.exe from the instance's directory, or
>running scm.exe from the Tools\Binn directory. Can someone show me the code
>they have used to install MSDE along with their apps that works? Thank you
>very much in advance for your help.
Have a look at the MSDE Installer example at
http://www.mvps.org/vbvision/
HTH,
Bryan
__________________________________________________ __________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@.mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
sql
Sunday, March 11, 2012
Creating a new database
create database krish on (Name='krish', filename='C:\Program Files\Microsoft SQL Server\MSSQL\data\krish.mdf', size=25, maxsize=50,filegrowth=5%)
This actually created the database. Now, I wanted to view this database info being stored inside the SQL Server system tables. I looked at "sysdatabases" table and found an entry as expected for "krish" but I could not trace where the info corresponding to the size of the database was stored ie.25MB . (I looked ad "sysdevices" but couldn't find any entry for the newly created database).
In which table is it stored ?
Any help is appreciated.select size
from krish.dbo.sysfiles|||Thanks Hans. That worked
creating a matching program
I'm just looking for some general advice on how to approach something.
I have two tables A and B, containg common fields of product, sales
date and qtyo.
Some records contain the same data and I want to dump them in a new
table called C and leave Tables A and B containg only data that
doesn'r match.
How do i go about approaching this??
Regards,
CiarnOn 22 Nov 2004 02:18:39 -0800, Ciar?n wrote:
>Hi,
>I'm just looking for some general advice on how to approach something.
>I have two tables A and B, containg common fields of product, sales
>date and qtyo.
>Some records contain the same data and I want to dump them in a new
>table called C and leave Tables A and B containg only data that
>doesn'r match.
>How do i go about approaching this??
>Regards,
>Ciarn
Hi Ciarn,
INSERT INTO C
SELECT A.Column1, A.Column2, ..., A.ColumnN
FROM A
INNER JOIN B
ON B.Column1 = A.Column1
AND B.Column2 = A.Column2
......
AND B.ColumnN = A.ColumnN
DELETE FROM A
WHERE EXISTS (SELECT *
FROM C
WHERE C.Column1 = A.Column1
AND C.Column2 = A.Column1
.......
AND C.ColumnN = A.ColumnN)
DELETE FROM B
WHERE EXISTS (SELECT *
FROM C
WHERE C.Column1 = B.Column1
AND C.Column2 = B.Column1
.......
AND C.ColumnN = B.ColumnN)
Enclose this all in a transaction, add error handling and you're set.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Cheers Hugo
Saturday, February 25, 2012
creating a database by sql script
Hi
I developed a program. This program will use a SQL server database. How can I create the database using code. I think I need to use sql scipt like this:
create database customers
But where should I write the script and How can I make VB code implement the script.
THanks a lot
You can just execute the sql statement.
e.g.
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = conn;
cmd.CommandText = "create database [db1]";
cmd.CommandType = CommandType.Text;
//execute
cmd.ExecuteNonQuery();
}
Thank you very much.
I used the following code. It worked in the first time. But when I debugged the program for the second time, I had this error " database db1 already exists"
How can I solve this problem?
And can you give me a sql script to create one database with one three-column table?
thanks
Using (cmdGet)
cmdGet.Connection = conGet
cmdGet.CommandText = "create database [db1]"
cmdGet.CommandType = CommandType.Text
cmdGet.ExecuteNonQuery()
End Using
|||
Code Snippet
'create db
cmdGet.CommandText = "if db_id('db1') is null exec('create database [db1]')"
cmdGet.CommandType = CommandType.Text
cmdGet.ExecuteNonQuery()
'create table
cmdGet.CommandText = "use db1; if object_id('tb1') is null exec('create table tb1(col1 int, col2 int, col3 int)')"
cmdGet.ExecuteNonQuery()
Friday, February 17, 2012
Created database at school but can't open it at home
Please help me.
I'm a college student working on a database project using MS SQL Server 2005 Express Edition.
The program (SQL SMSEE) is installed on both the computers in class and on two of my computers at home. The first installation resulted in the "remote connections" error. No matter what I do, I can't get the program to fully load. So I tried installing on another computer at home. The second installation went well. Didn't do anything different from the first installation, but any hoo....................
My 2-week old problem is this - I save my database that I do in class on my thumbdrive. Last class, I saved all the files that had my database's name on it on my thumbdrive--.mdf, .log, .bak, etc. On the second home computer, I cannot open the databases that I work on at school. Even my professor is stumped on this one.
Here is what I'm doing......
After I connect to the server, I right-click "Databases" then left-click "Restore Database".
In the "To database" box, I enter the name of the database, as I saved it at school.
In the "To a point in time" box, I leave the default "Most recent possible" entry.
I select "From device" as the location of backup and click the "..." button. The file is on my thumbdrive, so I click "Add" and select the location on my usb (with the .bak extension) and click OK.
I pick the most recent file checkbox and click "OK".
The green progress circle goes to 50% and then gets stuck. The database never opens and the Object Explorer shows the database name followed by "(Restoring...)". So if I try to do anything else with it, I get an error message stating the database in the middle of a restore and that I have to wait until its done. Well, of course it never finishes.
Please help me. Right now I am stuck doing duplicate work at home and at school and am making little to no progress. The final project is due on 26 March and right now I only have my tables, a few attributes and a couple of relationships. And I have a LOT more work to do.
Thanks.
i have more luck using the attach task than with restore --
not sure why -- but sounds like you have a need for speed so you might want to try using the attach task.
When you copied the files to your thumb drive was this a database backup or just a copy?
if its just a copy did you stop the sql engine before you made the copy (this is a "best practice")
then copy the .mdf and .ldf files
try using the attach task in smsee instead of restoring
1. copy the .mdf and .ldf files from your thumb drive to your computer.
2. open smsee and connect to a server --probably <yourcomputername>\SQLEXPRESS
3. in the object browser:
select the database node and right click
select the attach task on the context menu
4. an ATTACH DATABASE dialog will open -- click the add button
5. a LOCATE FILE... dialog will open -- drill down to the database.mdf file location and select it
and click OK on the LOCATE FILE dialog
6. the database details should be in the bottom of the ATTACH DATABASE dialog -- click OK
you should now have a node under the databases node for your attached database.
good luck
|||I LOVE YOU!!!!!!!!!!!!
(in context, of course )
You have just saved me from days of mental anguish. I'm telling you, I only had a few strands of hair left.
Now I don't have to do double work any more and I actually have a shot at completing this project on time.
Thank you so VERY much. I wish I would have visited this forum sooner.
Gotta go.........plenty work to be done!
.........did I say THANK YOU?