navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Security error

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Security error
Page: [1]
 
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
Security error - 7/25/2003 10:44:07   
I was wondering if someone could help me out with some asp pages that I am trying to write up. I am having a problem creating a connection to a database. All the ones I try I get security errors and errors saying that the recordset I create cannot be used with the type of connection I am using.
Thank for your time.
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Security error - 7/25/2003 11:00:22   
What kind of database are you using?

What connection type are you using?

If you can, post your current code and we' ll help you " de-bug" it

:)

_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 8:39:03   
Parden my ignorance on this please.

<%
dim oConn
dim rs_test

Set oConn = Server.CreateObject(" ADODB.Connection" )
oConn.Open(" Provider=sqloledb;Server=2mawcpsws01;Database=navtree;Trusted_Connection=yes" )

%>

(in reply to bobby)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 9:08:47   
Or is there some sort od sample connection code I could possibly see, I need to connect to a Access table in a database from a simple search page i need to develop.
Thanks again

(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 14:15:14   
I cant even get this little .asp or .htm to work together with a small table I build in Access, I know this has got to be something small to fix, any ideas, I really have no clue...
here is the code for the .asp page

<%
dim oConn ' Holds the Database Connection Object
dim rsaddcomments ' Holds the recordset for the new record to be added
dim strSQL ' Holds the SQL query to query the database

Set oConn = Server.CreateObject(" ADODB.Connection" )
oConn.Open " DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(" Test1.mdb" )
Set rsAddComments = Server.CreateObject(" ADODB.Recordset" )

strSQL = " SELECT tblASPTEST.First Name, tblASPTEST.Last Name, tblASPTEST.Children Name;"
rsAddcomments.CursorType = 2 ' navigation through record set'

rsAddcomments.LockType = 3 ' locks record'

rsAddcomments.Open strSQL, oConn

rsAddcomments.AddNew

rsAddComments.Fields(" First Name" ) = Request.Form(" First Name" )
rsAddComments.Fields(" Last Name" ) = Request.Form(" Last Name" )
rsAddComments.Fields(" Children Name" ) = Request.Form(" Children Name" )

rsAddComments.Update

rsAddComments.Close
Set rsAddComments = Nothing
Set oConn = Nothing
%>



here is the code for the .htm page

<HTML><HEAD>
<TITLE>Test For ASP</TITLE>

<style>
body{background-color:#30674b;font-weight:400}

table{border:5px;border-style:outset}
td.lang1{background-color:gray}
td.lang2{background-color:#a2a2a2}
td.lang3{background-color:gray}
td{background-color:#3a7676}
</style>

</HEAD>
<BODY>
<H1><center>ASP TEST</center></H1>
<P>
<HR>
<FORM METHOD=POST ACTION=" Test.asp" >
<table width=" 75%" align=" center" cols=2 cellpadding=4 border=0>
<tr><td>First Name:
<td width=" 40%" ><input type=text First Name=" last" size=" 20" >
<tr><td>Last Name:
<td><input type=text name=" Last Name" size=" 20" >
<tr><td>Children Name:
<td><input type=text name=" Children Name" size=" 20" >
</table><br><br>


<br><br>
<table width=" 75%" align=" center" cols=2 cellpadding=4 border=0>
<tr><td><center><button type=" submit" >Submit Query</button></center>
<Td><center><button type=" reset" >Start Over</button></center>
</table>
<br><hr>
</form>
</body>
</html>

Thanks again

(in reply to bobby)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Security error - 7/30/2003 14:49:06   
quote:

oConn.Open " DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(" Test1.mdb" )


51,

MapPath:
Change: Server.MapPath(" Test1.mdb" ) to Server.MapPath(" /Test1.mdb" )
Is your database in your root, or is it in the fpdb directory? If so then:
Server.MapPath(" /fpdb/Test1.mdb" )

This might be easier:

connect = " fpdb/Test1.mdb"
Set dConn = Server.CreateObject(" ADODB.Connection" )
dPath = Server.MapPath(connect)
sql = " INSERT INTO tblASPTEST (FirstName, LastName, ChildrenName) VALUES (' ::FirstName::' , ' ::LastName" , ' ::ChildrenName::' )"
dConn.Open " Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & dPath & " ;"
dConn.execute(sql)
dConn.Close


Note:
When you create database fields, never include spaces. Your fields should be:

BAD
First Name

CORRECT
FirstName

Hope this helps.
LLLuneeeee :)

< Message edited by Long Island Lune -- 7/30/2003 2:52:02 PM >


_____________________________


(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 15:26:29   
Thanks for your time and help, but I still cannot get any new records added to the test table, eventualy I would like to search the table as well, but first I need to input the data, any other ideas, it seems so simple.
Thanks again

(in reply to 51)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Security error - 7/30/2003 15:45:27   
51,

You might want to check out the following:

http://www.w3schools.com/ado/default.asp
http://www.devguru.com/Technologies/ado/quickref/ado_intro.html
http://www.adoguy.com/

... for learning purposes.

I' ll take another look at your code again.

< Message edited by Long Island Lune -- 7/30/2003 3:45:43 PM >


_____________________________


(in reply to 51)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Security error - 7/30/2003 15:54:07   
51,

Question:

Did you create the database INSIDE Access and import it in to your FP project?

_____________________________


(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 16:05:48   
Yes I did create the database with the table inside Access, however I never imported it into a FP project, the server I am on does not have server extensions, I am allowed to an ODBC connection though through Access.
The .asp and the .htm pages i have code for I wrote in notepad, then just pasted them in the root directory of the server.

(in reply to Long Island Lune)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Security error - 7/30/2003 16:22:46   
Ouch, not a fun way to do it.

Can you install the extensions, then import the database in to FP?
Are you on an NT or Unix server?

_____________________________


(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/30/2003 16:27:23   
You guessed it, NT. I am a Civilian on a DOD server and Im not allowed to put FP server extensions on the server, actually im not even supposed to use FP at all so I am trying to work around the obsticles the best that I can.
Thank you again for you time and Patience.

(in reply to Long Island Lune)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Security error - 7/30/2003 16:30:31   
Work on the display of data first - then add an update form.
Is there a specific error that come up when accessing the page?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to 51)
51

 

Posts: 49
Joined: 5/30/2002
From:
Status: offline

 
RE: Security error - 7/31/2003 7:27:15   
No, I get no error, I just get a page in the browser that dispays the .asp code. I then check the table (everything is spelled correctly in the code that correspond to the table) and it was not updated.

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Security error - 7/31/2003 15:43:49   
The page displays the asp code? does the server support scripting / asp?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to 51)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Security error
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts