Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-2008, 08:42 PM
Gold-bug
 
Posts: n/a
Logon to a SQL Server

Hi, All,

I have two basic ASP pages and I'm trying to connect to a SQL Server 2005
Database which is on a different computer (Server-001).
The first file is called TestTwo.asp and is in the root/folder: Connections

It connect is below:

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_TestTwo_STRING
MM_TestTwo_STRING = "dsn=Hagis SQL Server;uid=czwanenburg;pwd=silverbird262;"
%>

A very basic webpages called LoginOne.asp has the following code:

<%@LANGUAGE="VBSCRIPT"%>

<!--#include file="Connections/TestTwo.asp" -->

<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_TestTwo_STRING
Recordset1.Source = "SELECT * FROM dbo.BullionProductName"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>

<style type="text/css">
<!--
body {
background-color: #FFFFE6;
}
.style1 {
font-size: 14px;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
<title>Hagis Net</title>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>


Anytime I put something within the statement between: <% %> my page shows
not the webpage in the browser but directly the code itself. It seems that not
only the login script when I put it between these: <% %>, but also the rest
doesn't work out well.

I think that the TestTwo.asp page is OK, because when I run a test within
Dreamweaver MX 2004 the Recordset gives the SQL record and its content. So
testing within Dreamweaver has a link/connection with my server and has the
right authority, hence the correct UID and PWD.

May anyone could make sense of it.


<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_TestTwo_STRING
MM_TestTwo_STRING = "dsn=Hagis SQL Server;uid=czwanenburg;pwd=silverbird262;"
%>



<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_TestTwo_STRING
Recordset1.Source = "SELECT * FROM dbo.BullionProductName"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>

<style type="text/css">
<!--
body {
background-color: #FFFFE6;
}
.style1 {
font-size: 14px;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
<title>Hagis Net</title>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

Reply With Quote
  #2 (permalink)  
Old 08-05-2008, 09:09 PM
bregent
 
Posts: n/a
Re: Logon to a SQL Server

Is this on your local or remote server? Does the server support ASP? Do you have a local web server and is it configured properly?
Reply With Quote
  #3 (permalink)  
Old 08-05-2008, 10:01 PM
Gold-bug
 
Posts: n/a
Re: Logon to a SQL Server

Hi there,

to all your questions I can see Yes. Currently I'm running a full intranet
with 100+ webpages and ASP pages on a remote server in a local network. The
webpage connect to a seperate disk with an ACCESS Database. All this works, so
connections, script and routing seems OK.

I'm switching from MS Access to MS SQL server 2005. Dreamweaver properly makes
the connection, but the pages that I copied from my website that had a correct
connection with de Access Dbase now doens't connect to MS SQL, although
Dreamweaver seems to have made the right connection.

Hope this helps.

Looking forward to hear from you,

Carl.

Reply With Quote
  #4 (permalink)  
Old 08-05-2008, 10:16 PM
Hunter Elliott
 
Posts: n/a
Re: Logon to a SQL Server


"Gold-bug" <webforumsuser@macromedia.com> wrote in message
news:g7aafo$c2t$1@forums.macromedia.com...
> Hi, All,
>
> I have two basic ASP pages and I'm trying to connect to a SQL Server 2005
> Database which is on a different computer (Server-001).
> The first file is called TestTwo.asp and is in the root/folder:
> Connections
>
> It connect is below:
>
> <%
> ' FileName="Connection_odbc_conn_dsn.htm"
> ' Type="ADO"
> ' DesigntimeType="ADO"
> ' HTTP="false"
> ' Catalog=""
> ' Schema=""
> Dim MM_TestTwo_STRING


I do hope you quickly go back to that server and change your password if not
both the username and password as you just broadcast the login info to the
world :(



Reply With Quote
  #5 (permalink)  
Old 08-05-2008, 10:49 PM
bregent
 
Posts: n/a
Re: Logon to a SQL Server

>I do hope you quickly go back to that server and change your password if not
>both the username and password as you just broadcast the login info to the
>world :(


Ouch!
Reply With Quote
  #6 (permalink)  
Old 08-05-2008, 10:56 PM
bregent
 
Posts: n/a
Re: Logon to a SQL Server

>to all your questions I can see Yes.

Well I am confused. On one hand you say that the browser is displaying the ASP
code which tells me it's not being parsed by the ASP engine. Is that still
happening?

Regarding the connection problem, did you create the ODBC DSN on the server?
Have you tried using a DSN-less connection?

Reply With Quote
  #7 (permalink)  
Old 08-06-2008, 04:29 PM
Gold-bug
 
Posts: n/a
Re: Logon to a SQL Server

Hi Bregent,

The moment I put script between the <% %>, the webpages displays in the frame
just code.
If I only have style information I got a nice blank page. Even some code that
creates buttons, etc. is no problem. i.e. HTML code is fine, but code to access
the Database is a no go. I think it has to do with the fact that the webpage
tries to access the SQL dbase and bounces. That fact alone creates a
malfunction why the frame as part of the webpages doesn't respond properly and
presents just the code.

I also think that the SQL server first needs to accept the webpages bases on
an approved/accepted UID and PSW.

So what I'm looking for is the correct script which will open a link to the
SQL Dbase.

I think something like the following code should do the trick, but for now, no
luck.

Hope jou have some thoughts.

Kind Regards, Carl.

Driver={SQL Native
Client};Server=myServerAddress;Database=myDataBase ;Uid=myUsername;Pwd=myPassword
;

Reply With Quote
  #8 (permalink)  
Old 08-06-2008, 04:40 PM
bregent
 
Posts: n/a
Re: Logon to a SQL Server

>I think it has to do with the fact that the webpage tries to access the SQL
dbase and bounces.
>That fact alone creates a malfunction why the frame as part of the webpages

doesn't respond
>properly and presents just the code.


I doubt it. If that was the fact it would indicate a seriously misconfigured
IIS/ASP server. Exposing your server side code as a result of a database error
would be a huge security risk.

Does other non-database related ASP code execute properly? Is this occurring
on a local testing server, or on a remote server or both?

Reply With Quote
  #9 (permalink)  
Old 08-06-2008, 06:58 PM
Gold-bug
 
Posts: n/a
Re: Logon to a SQL Server

Other non-database relate items works fine.

I'm using one workstation in a direct link with a server station. On both
stations XP is running. On the Server station I have a disk D: within a
subdirectory all my intranet pages. On disk E: I have the SQL running. From the
Workstation I normally open a page (Server/D:/x.asp) and that works fine. Now
the webpage needs to get access to the SQL Dbase (Server/E:/SQLDbase).

That's basicly how the network is setup. I'm think of having a separate
station for the webpages and a separate for just SQL. Hopefully that makes life
easyer.

But it should work.

P.S. on disk F: an MS Access Dbase is running now and that works fine, no
problems at all, but Access is open as hell. SQL needs approvall first i quest!

Hope this helps.

Thanks, Carl.

Reply With Quote
  #10 (permalink)  
Old 08-06-2008, 07:32 PM
bregent
 
Posts: n/a
Re: Logon to a SQL Server

>From the Workstation I normally open a page (Server/D:/x.asp) and that works
fine.

How are you opening this page? From the network filesystem as you seem to
incidicate above, or from the webserver?

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Software > Adobe Software > Dreamweaver


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:33 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Car Parts and Accessories | Wire Transfer | Web Advertising | Credit Cards | Online Image Resizer



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114