Just nu i M3-nätverket
Jump to content

Set title = conn.Execute("SELECT title FROM main WHERE id = variabel")


SNY

Recommended Posts

Så här långt har jag kommit:

 

[color="#0000ff"]Set[/color] pagenr = [b]Request[/b].QueryString([GRÅ]"pagenr"[/GRÅ]) 
[color="#0000ff"]If[/color] pagenr = [color="#0000ff"]Null[/color] [color="#0000ff"]Then[/color] pagenr = 1

[color="#0000ff"]Set[/color] Conn = [b]Server[/b].[color="#0000ff"]CreateObject[/color]([GRÅ]"ADODB.Connection"[/GRÅ])
DSNtest=[GRÅ]"DRIVER={Microsoft Access Driver (*.mdb)}; "[/GRÅ]
DSNtest=dsntest & [GRÅ]"DBQ="[/GRÅ] & [b]Server[/b].MapPath([GRÅ]"main.mdb"[/GRÅ])
Conn.Open DSNtest

[color="#0000ff"]Set[/color] title = conn.[color="#0000ff"]Execute[/color]([GRÅ]"SELECT title FROM main WHERE id = pagenr"[/GRÅ]) 
[color="#0000ff"]Set[/color] content = conn.[color="#0000ff"]Execute[/color]([GRÅ]"SELECT content FROM main WHERE id = pagenr"[/GRÅ]) 

 

Jag fattar bara inte hur jag ska få where id = pagenr (en variabel) att funka. Nån som vet?

 

Link to comment
Share on other sites

[color="#0000ff"]Set[/color] title = conn.[color="#0000ff"]Execute[/color]([GRÅ]"SELECT title FROM main WHERE id ="[/GRÅ] &  pagenr) 
[color="#0000ff"]Set[/color] content = conn.[color="#0000ff"]Execute[/color]([GRÅ]"SELECT content FROM main WHERE id ="[/GRÅ] &  pagenr) 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...