![]() |
|
|
Connecting to SQL database via Dreamweaver |
|
Experienced Talker
Posts: 32
|
Hi All
I had the crazy idea of building a site using asp.net and SQL Server via Dreamweaver.!!!! To help me on my way I decided to build a tiny test site just to establish the connections. However, try as I might I can’t make a connection to a database and am now rapidly loosing the will to live due to the quite unbelievable time I have spent trying to sort this out. Now this post is my last best chance. I am trying to connect to either of the databases that come with the freebee SQL Server package (Is it called express or something?). They are pubs and Northwind. I am using Dreamweaver 8, XP Professional with the .Net framework v2.0 The connection string reads "Data Source=[Computer Name]\SQLEXPRESS; Initial Catalog=pubs; However, I get a choice of two different error messages depending on my computer’s mood (I don’t change ANYTHING) The first is the beautifully succinct and entirely unhelpful “an unidentified error has occurred”. The second reads: 1) There is no testing server running on the server machine 2) The testing server specified for this site does not map to the http://localhost URL despite the fact that there quite clearly is a testing server running. After more hours trawling the net for answers, than I care to admit to I decided in desperation to try out the Dreamweaver tutorial that deals with these things (Café Townsend) to see if it offered any clues. However, when attempting to connect to the database (tutorial.mdb) I get the same two error messages, again dependent on my computer’s mood. Ok. I could give you a blow by blow account of all the things I have tried but this post is too long already. Suffice to say that there IS a testing server running and everything maps to where it should…I am uncertain about the connection string! Any help in the right direction would be appreciated more than you can imagine. Cheers Burnsie |
|
|
|
| Sponsored Links (We share ad revenue): |
|
|
Re: Connecting to SQL database via Dreamweaver | |
|
Half Man, Half Amazing
![]()
Latest Blog Post:
North Lake Union Posts: 2,924
Name: Forrest Croce
Location: Seattle, WA
|
Quote:
Instead of Dreamweaver, use MS's Web Dev Express. This will let you edit the markup and code, somewhat like DW, but it also comes with a test server to run your code for you. |
|
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Skilled Talker
Posts: 54
Name: Web Design Company
Location: London
|
i dont like this MS's Web Dev Express because it doesnt have PHP support
__________________
Website design |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,093
Name: John Alexander
|
Sure it does. Either you can open a PHP file and edit it, or you can install PHP.NET. But if you're trying to write code against a Microsoft Internet Information Services server, that kind of goes with the territory. You can't run Windows Explorer on a Mac, either.
If you want to run ASP.NET code, you need a web server to execute that code for you. If you don't want to use Web Developer, your choices are XP Pro and Windows Server 2003.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver | ||
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,093
Name: John Alexander
|
Quote:
Quote:
Server=localhost; Database=Pubs; Integrated_Security=SSPI; If you're trying to connect to a SQL Server database, the path to an Access file is irrelevant. Also if you want to connect to the database, you need credentials before the server will let you in. The cstr I wrote, above, passes through your NT credentials. I'm assuming your Windows login is allowed to use the db? You still need your code to run, in order to build the connection into the database, as described by your connection string. Put simply, Dreamweaver won't do that for you. It's a web page editor, not a web server.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
||
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Half Man, Half Amazing
![]()
Latest Blog Post:
North Lake Union Posts: 2,924
Name: Forrest Croce
Location: Seattle, WA
|
You're trying to connect to the database through .net code in the System.Data.SqlClient namespace, right?
Does Express come with SSMS, as a client tool to manage the database? It should be in your start menu under SQL Server 200x, as "SQL Server Management Studio." You can connect to the database using that, right? It's going to ask you for most of the things that need to be in a connection string for SQL Server. Mainly, you need to grab the server name. It should be your machine name, except that from two of your posts, it looks like you're trying to access a named instance. You can install SQL Server dozens of times on the same machine, and make each one it's own, sandboxed environment. The first one doesn't get a name, and is usually called the default instance. The rest need names to distinguish. Normally you just ask for "Server=MachineName" but if you're using a named instance it has to be "Server=MachineName\InstanceName" ... the point is that if you're not using a named instance, you won't be able to connect to it using those semantics. You'd usually get a "server doesn't exist or access denied" message, though. You need:
If you want to do this through .net code, you've got a number of languages at your disposal. Most people choose C# or VB, but there are plenty of others. I use C# ... everybody in most of the companies I've worked in for several years have, but I'm in Microsoft's back yard. Anyway, C# code to play with a SQL Server database looks like this: PHP Code:
I don't think VB has using blocks, so you'd have to write that a little differently. Mainly with try blocks, and explicitly calling Dispose. |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,093
Name: John Alexander
|
Wow, dude, I didn't realize you knew that much about sequel?
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver | ||
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,093
Name: John Alexander
|
Quote:
Quote:
You're trying to do something that requires 2 servers, but you're only using 1. The solution to your problem is to use a web server! As previously explained, you can use IIS which is part of Windows Server and Windows XP, or you can use the test server inside Visual Studio and Visual Web Developer Express.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
||
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Average Talker
Posts: 15
Name: Chris
Location: UK
|
I didn't even read the first post correctly, apologies there.
Follow the instructions here to install IIS, then install the .Net Framework 2.0 again. http://www.webwizguide.com/kb/asp_tu..._winXP_pro.asp
__________________
Chris .Net C# ASP.NET Developer Windows Systems Administrator |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Super Moderator
![]() Posts: 10,682
Location: Blackpool. UK
|
open the page in a browser and see what the error really is.
__________________
Chris. ->> Links are advertising NOT optimising!! <<- Indifference will be the downfall of mankind, but who cares? Code Samples | People Counting System |
|
|
|
|
|
Re: Connecting to SQL database via Dreamweaver |
|
Experienced Talker
Posts: 32
|
Hi All
When testing the database connection for the Dreamweaver tutorial (Café Townsend) I get the following message: 1) There is no testing server running on the server machine 2) The testing server specified for this site does not map to the http://localhost/MySampleApps/_mmSer...s/MMHTTPDB.asp URL, Verify that the URL Prefix maps to the root of the site. This is interspersed with the message: ‘an unidentified error has occurred’ for no apparent reason whatsoever! When testing the connection for either of the SQL Server sample databases (pubs, Northwind) I get the exact same two messages with the exact same frequency. (Obviously the root folder is different from ‘MySampleApps’) Cheers Burnsie |
|
|
|