Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Go Back  Xtreme Visual Basic Talk > > > Deploying VB app that has an SQL server database?


Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2006, 03:09 PM
chrisjb chrisjb is offline
Freshman
 
Join Date: Aug 2006
Posts: 26
Question Deploying VB app that has an SQL server database?


hello,

1. currently am making a windows app that uses a SQL Server 2005 database file (employeedb1.mdf).
2. app works fine on my machine, connects, displays data.

Question:

1. using the deployment wizard inside Visual Basic 2005 (which means: Add New Project + Setup and Deployment Project + Setup Project).
2. building the deployment setup project
3. After installing the package on another client machine, why does the client not "see" the SQL Server file ?

In a nutshell: wish to deploy my App onto a client such that it reads the database file on that client. The database is being moved onto the client (it's a single-user database file for a client's client computer!)

Chris.
Reply With Quote
  #2  
Old 09-08-2006, 10:48 PM
wayneph's Avatar
waynephDeploying VB app that has an SQL server database? wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Is your installer application installing SQL Express? I don't think you can just send the file like you can with Access. You need to have SQL Server running on the client.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 09-11-2006, 10:12 AM
chrisjb chrisjb is offline
Freshman
 
Join Date: Aug 2006
Posts: 26
Exclamation

Quote:
Originally Posted by wayneph
Is your installer application installing SQL Express? I don't think you can just send the file like you can with Access. You need to have SQL Server running on the client.
I do have SQL Server running on the client.

On my development machine, the ConnectionString looks like this:
"Data Source=.;Initial Catalog=employeeSQLdatabase1;Integrated Security=True"
Where the period (.) means the name of the development machine.

Do you think I need to change the machine-name to the client's name?
Reply With Quote
  #4  
Old 09-11-2006, 10:15 AM
wayneph's Avatar
waynephDeploying VB app that has an SQL server database? wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

No, the period should work. In your applicaiton installer are you running something that attaches the files to SQL? Just putting them there doesn't make them available.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 09-11-2006, 10:21 AM
chrisjb chrisjb is offline
Freshman
 
Join Date: Aug 2006
Posts: 26
Exclamation

Quote:
Originally Posted by wayneph
No, the period should work. In your applicaiton installer are you running something that attaches the files to SQL? Just putting them there doesn't make them available.
I'm using the Visual Studio installer, and doing the following:

1. adding an Installer project to my development project.
2. rclick the Application Folder node, and select "Project Output."
3. from that menu, selecting "Primary Output" which says "Contains the DLL or EXE built by the project."
4. building the Installer project, and then copying the .msi and .exe files to the client's machine.

thanks for any help,
chris.
Reply With Quote
  #6  
Old 09-11-2006, 10:33 AM
wayneph's Avatar
waynephDeploying VB app that has an SQL server database? wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

But none of that includes the .mdf file for the database... Are you deploying that to the client separately? To be honest, I've never had to deploy a database, so I'm not sure the best way to do it. In your installer, you'll need to give the user the option to log in to SQL and run a script that attaches the .mdf file to their SQL Server.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #7  
Old 09-11-2006, 10:48 AM
chrisjb chrisjb is offline
Freshman
 
Join Date: Aug 2006
Posts: 26
Exclamation

Quote:
Originally Posted by wayneph
But none of that includes the .mdf file for the database... Are you deploying that to the client separately? To be honest, I've never had to deploy a database, so I'm not sure the best way to do it. In your installer, you'll need to give the user the option to log in to SQL and run a script that attaches the .mdf file to their SQL Server.
Oh I see what you're saying. I've been just copying the .mdf file to the client machine (separately).

Okay, I need to somehow include the .mdf file in the installment package. I haven't done this either.

I'm going to look at the Visual Studio installer and find out how one includes an .mdf file in the package.

I have been developing the SQL .mdf file on my development machine alongside the app. Perhaps it would be better to build the SQL .mdf file onto the client's machine first, and only do development on say a similar SQL Express file?
Reply With Quote
  #8  
Old 09-14-2006, 05:45 PM
IUnknown's Avatar
IUnknown IUnknown is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Oct 2004
Location: Montréal
Posts: 1,135
Default

Hi, Two things you might want to look out for are:
1. Check the SQL server instance you are attaching your .mdf to. If it's the default instance, . is fine but otherwise, you'd have to specify it in your connection string like .\PROD for example.
2. Users and security on your client's Server and SQL Server.
__________________
win7 : vs 2008 : .Net 3.5
Reply With Quote
  #9  
Old 09-19-2006, 06:34 PM
Mark McLeroy Mark McLeroy is offline
Regular
 
Join Date: May 2006
Posts: 50
Default

Quote:
Originally Posted by chrisjb
Oh I see what you're saying. I've been just copying the .mdf file to the client machine (separately).

Okay, I need to somehow include the .mdf file in the installment package. I haven't done this either.

I'm going to look at the Visual Studio installer and find out how one includes an .mdf file in the package.

I have been developing the SQL .mdf file on my development machine alongside the app. Perhaps it would be better to build the SQL .mdf file onto the client's machine first, and only do development on say a similar SQL Express file?
If I may put my 2 cents in (and I may be way off base because I am new at this but..) if I am understanding you correctly, your user has SQLExpress installed and running on their machine. Your installation package copies the SQL database to the users hard drive. At this point the SQL Server has no idea the database is there. You would have to attach it to the server either by VB code or using Microsoft's SQL Server Management Studio Express. Please let me know if I was on the right track.

Thanks

Mark McLeroy
Reply With Quote
  #10  
Old 09-21-2006, 11:21 AM
chrisjb chrisjb is offline
Freshman
 
Join Date: Aug 2006
Posts: 26
Default

Thanks all,

Those ideas are working. I did an extra step by writing Transact-SQL to "CREATE DATABASE" onto the server machine. Now, I'm having trouble getting my DLL to OPEN that database on the machine.

Question: Do I still have to give 'permissions' to my server, so that the Client (remote somewhere on the LAN) can get to it? This is a bit confusing here. I'm going to attempt TCP/IP permissions in the meantime.

Thanks for any help,

Chris.



Quote:
Originally Posted by Mark McLeroy
If I may put my 2 cents in (and I may be way off base because I am new at this but..) if I am understanding you correctly, your user has SQLExpress installed and running on their machine. Your installation package copies the SQL database to the users hard drive. At this point the SQL Server has no idea the database is there. You would have to attach it to the server either by VB code or using Microsoft's SQL Server Management Studio Express. Please let me know if I was on the right track.

Thanks

Mark McLeroy
Reply With Quote
  #11  
Old 09-23-2006, 11:33 PM
Mark McLeroy Mark McLeroy is offline
Regular
 
Join Date: May 2006
Posts: 50
Default

Quote:
Originally Posted by chrisjb
Thanks all,

Those ideas are working. I did an extra step by writing Transact-SQL to "CREATE DATABASE" onto the server machine. Now, I'm having trouble getting my DLL to OPEN that database on the machine.

Question: Do I still have to give 'permissions' to my server, so that the Client (remote somewhere on the LAN) can get to it? This is a bit confusing here. I'm going to attempt TCP/IP permissions in the meantime.

Thanks for any help,

Chris.

Hi Chris:

I don't think you would give permission to a server. Instead use Microsoft SQL Server Management Studio to create a new user (Click Security folder then, right click logins, then select "New Login"). Give the new user a name and password. If your client is accessing the server from a remote machine I would then choose SQL Server Authentication (it makes administration much easier). Then click Server Roles (in the left column) and give the user the permissions you wish. You would then create a connection string with that user name and password in your application. When you create the connection string you can hard code the user name and password into the program, but that's not very secure. It would be better to have the program ask for a user name and password then use that information to create the connection string.

Speak to you soon.

Mark McLeroy
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database? Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
 
Deploying VB app that has an SQL server database?
Deploying VB app that has an SQL server database?
 
-->