Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 will this work??
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Spoon
Average Member

Ireland
507 Posts

Posted - 24 June 2001 :  12:54:11  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
Can someone tell me if this code will work. I made it myself, im a beginner and wont be getting access till next week.

here is the edit page that displays info in 3 forms, and then is sent of to seperate pages.

-------------------------------------------
-------------------------------------------
Edit Page
-------------------------------------------
-------------------------------------------

<%@ LANGUAGE="VBSCRIPT"
ENABLESESSIONSTATE = False
%>
<%
'Open the database and use our variables stated above
Set BMWR = Server.CreateObject("ADOBD.Recordset")
Set BMW = Server.CreateObject("ADODB.Connection")
BMWW "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
sqlstmt = "SELECT * from Body"
' connect to the database and execute query
BMWR.open sqlstmt, BMWW

pagetitle = BMWR("pagetitle")
webmaster = BMWR("webmaster")
styles = BMR("styles")
%>

<%
Set BMWR = Nothing
BMWR.close
Set BMW = Nothing
BMW.close
%>



---------------------------------------------------
---------------------------------------------------
Here is one the page that "pagetitle" is sent of to
pgt.asp
---------------------------------------------------
---------------------------------------------------

<%
@ LANGUAGE = "VBScript"
ENABLESESSIONSTATE = False
%>
<% Response.Buffer = "True" %>
<%
'Open the database and use our variables stated above
Set BMW = Server.CreateObject("ADODB.Connection")
BMWW "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
sqlstmt = "SELECT * from Body"
' connect to the database and execute query
BMW.open sqlstmt, BMWW

' Request the
' variables to add to the db:
pagetitle = Request.Form("pagetitle")
If pagetitle = "" Then pagetitle = ".: Joe Duffy Motors :."
' If we want to add a new record uncomment
' the addnew below.
' here we name the variables to what to update
' we update and then close the db to save server
' BMW.AddNew
BMW.Fields("pagetitle") = pagetitle
BMW.Update
BMW.Close
Set BMW = Nothing
%>
<% Response.Redirect("default.asp") %>


---------------------------------
---------------------------------

The other pages are similar (the other ones that process the other two forms

--------------

i would be really grateful if someone could tell me if there is any problems with the code and how i can fix it

Thx :)

"uohh look at me, ive got a signature, uohh look at me!" :)

Edited by - spoon on 25 June 2001 14:53:04

Spoon
Average Member

Ireland
507 Posts

Posted - 25 June 2001 :  14:53:36  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
please :(

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 25 June 2001 :  14:56:31  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
please :(

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 25 June 2001 :  16:23:41  Show Profile  Visit HuwR's Homepage
The code looks OK, but you do not appear to have any forms, it is just a small piece of your code, and is difficult to tell you if there may be a problem, without seeing the other code

Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 25 June 2001 :  19:37:39  Show Profile  Send mafifi an ICQ Message
Set BMWR = Server.CreateObject("ADOBD.Recordset")

Thanks,

Mo
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 26 June 2001 :  10:33:13  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

Set BMWR = Server.CreateObject("ADOBD.Recordset")

Thanks,

Mo



Thx Guys!

I took out the form because it took up too much space,
I know the form will work though, thx guys,

Spoon

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page

Craig from Alberta
Starting Member

Canada
7 Posts

Posted - 26 June 2001 :  18:42:29  Show Profile  Visit Craig from Alberta's Homepage
You might want to open the Connection object before you open the Recordset object.

Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 28 June 2001 :  17:14:11  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

You might want to open the Connection object before you open the Recordset object.





How do i do that, and y?

thx :)

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 28 June 2001 :  19:02:55  Show Profile  Send mafifi an ICQ Message

<%@ LANGUAGE="VBSCRIPT"
ENABLESESSIONSTATE = False
%>
<%
'Open the database and use our variables stated above
Set BMW = Server.CreateObject("ADODB.Connection")
Set BMWR = Server.CreateObject("ADODB.Recordset")

BMWW "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
sqlstmt = "SELECT * from Body"
' connect to the database and execute query
BMWR.open sqlstmt, BMWW
pagetitle = BMWR("pagetitle")
webmaster = BMWR("webmaster")
styles = BMR("styles")
%>
<%
Set BMWR = Nothing
BMWR.close
Set BMW = Nothing
BMW.close
%>



Thanks,

Mo
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 29 June 2001 :  07:07:00  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:


<%@ LANGUAGE="VBSCRIPT"
ENABLESESSIONSTATE = False
%>
<%
'Open the database and use our variables stated above
Set BMW = Server.CreateObject("ADODB.Connection")
Set BMWR = Server.CreateObject("ADODB.Recordset")

BMWW "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
sqlstmt = "SELECT * from Body"
' connect to the database and execute query
BMWR.open sqlstmt, BMWW
pagetitle = BMWR("pagetitle")
webmaster = BMWR("webmaster")
styles = BMR("styles")
%>
<%
Set BMWR = Nothing
BMWR.close
Set BMW = Nothing
BMW.close
%>



Thanks,

Mo




Cheers mo, gosh, everyone is so kind :) lol

thx again, Spoon

"uohh look at me, ive got a signature, uohh look at me!" :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07