Author |
Topic  |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 24 June 2001 : 12:54:11
|
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
|
please :(
"uohh look at me, ive got a signature, uohh look at me!" :) |
 |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 25 June 2001 : 14:56:31
|
please :(
"uohh look at me, ive got a signature, uohh look at me!" :) |
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 25 June 2001 : 16:23:41
|
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
|
 |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 25 June 2001 : 19:37:39
|
Set BMWR = Server.CreateObject("ADOBD.Recordset")
Thanks,
Mo |
 |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 26 June 2001 : 10:33:13
|
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!" :) |
 |
|
Craig from Alberta
Starting Member
Canada
7 Posts |
Posted - 26 June 2001 : 18:42:29
|
You might want to open the Connection object before you open the Recordset object.
|
 |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 28 June 2001 : 17:14:11
|
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!" :) |
 |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 28 June 2001 : 19:02:55
|
<%@ 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 |
 |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 29 June 2001 : 07:07:00
|
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!" :) |
 |
|
|
Topic  |
|