2012-10-05 147 views
-4

我想转换代码的下方(SQL)在经典的.asp转换SQL代码为VBScript(经典ASP)

select nomerazaosocial from tab_participante where participanteid in (
SELECT  ParticipanteId 
FROM   dbo.Rel_Grupo_Participante 
where grupoid in (6,110)) 

感谢

+2

你尝试过什么,还是你只是在等待的代码? –

+1

当你说你想要转换代码时,你是什么意思?是否真的想要*使用VBScript代码中的查询? – Guffa

+0

所有的查询都是相同的asp.net或VBScript或PHP ....你需要问的是如何使用它在VBScript – polin

回答

1

提问有望尝试之前独立解决他们的问题问。你的问题没有任何意义,因为你不能“转换”任何东西 - 所以这对你很难。

无论如何,请通过谷歌搜索,例如“传统的ASP数据库查询”,你会发现实例来上手,如:

<html> 
<title>Queries from the MS-SQL database with ASP</title> 
<body bgcolor="FFFFFF"> 
<h2>Query from table <b>products</b> with ASP</h2> 

<% 

Set conn = Server.CreateObject("ADODB.Connection") 
conn.open "PROVIDER=SQLOLEDB;DATABASE=PiccoCeraci" 

'This code block will create a recordset 
Set rs = Server.CreateObject("ADODB.Recordset") 
SQL = "select * from products" 
rs.open SQL, conn 

'will iterate to display the records got from the database 
While Not rs.EOF 
response.write(rs("id") & " " & rs("price")) 
rs.MoveNext 
Wend 

'closes the connection 
rs.close 
conn.close 
Set rs = Nothing 
Set conn = Nothing 

%> 
</body> 
</html> 

source