Mange danske iværksættere og mindre virksomheder stiller sig det samme spørgsmål, inden de køber webhotel: Kan jeg stole på, at prisen, driften og supporten holder, når introduktionsperioden er slut?
sql = "SELECT count(id_nr) as antal FROM brugersvogne WHERE VognID=" & lngRecordNo &" AND BrugerID=" & Session("UserID") set rscount = dbc.Execute(sql) antal = rscount("antal") set rscount = nothing
Hmmm Mit problem er at jeg skal have kørt 2 SQL'er på samme side.
Du kan se hele siden her :
<% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsGuestbook 'Holds the recordset for the record to be updated Dim strSQL 'Holds the SQL query for the database Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT * FROM vogne WHERE id_no=" & lngRecordNo
'Open the recordset with the SQL query rsGuestbook.Open strSQL, adoCon %> <html> <head> <title>View_selected</title> <link rel="stylesheet" type="text/css" href="style.css">
sql = "SELECT count(id_nr) as antal FROM brugersvogne WHERE VognID=" & lngRecordNo &" AND BrugerID=" & Session("UserID") set rscount = dbc.Execute(sql) antal = rscount("antal") set rscount = nothing
If antal > 0 Then Response.write ("Er I din samling") Else Response.Write ("<a href=""tilfoj_brugersvogn.asp?ID=" & rsGuestbook("ID_no") & """>") Response.write ("<FONT size=1 face=verdana>Tilføj vogn til min samling</FONT>") Response.Write ("</a>") End If %> </body> </html> </font> <% 'Reset server objects rsGuestbook.Close Set rsGuestbook = Nothing Set adoCon = Nothing %>
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/vogne_view_selected.asp, line 204
<% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsGuestbook 'Holds the recordset for the record to be updated Dim strSQL 'Holds the SQL query for the database Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=guestbook"
'Create an ADO recordset object Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT * FROM vogne WHERE id_no=" & lngRecordNo
'Open the recordset with the SQL query rsGuestbook.Open strSQL, adoCon %> <html> <head> <title>View_selected</title> <link rel="stylesheet" type="text/css" href="style.css">
sql = "SELECT count(id_nr) as antal FROM brugersvogne WHERE VognID=" & lngRecordNo &" AND BrugerID=" & Session("UserID") set rscount = adoCon.Execute(sql) antal = rscount("antal") set rscount = nothing
If antal > 0 Then Response.write ("Er I din samling") Else Response.Write ("<a href=""tilfoj_brugersvogn.asp?ID=" & rsGuestbook("ID_no") & """>") Response.write ("<FONT size=1 face=verdana>Tilføj vogn til min samling</FONT>") Response.Write ("</a>") End If %> </body> </html> </font> <% 'Reset server objects rsGuestbook.Close Set rsGuestbook = Nothing Set adoCon = Nothing %>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.