将SQL代码转换为VBScript(经典ASP)

时间:2020-12-16 01:35:55

I want to convert the code below (in SQL) in classic .asp

我想在经典的.asp中转换下面的代码(在SQL中)

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

Thanks

1 个解决方案

#1


1  

Questioners are expected to try to fix their problem independently before asking. Your question doesn't really make any sense as you can't "convert" anything per se - so this will hardly help you.

在询问之前,询问者应该尝试独立解决问题。你的问题没有任何意义,因为你不能“转换”任何东西本身 - 所以这对你几乎没有帮助。

In any case, please read up by Googling, e.g. "classic asp database query", and you will find examples to get started such as:

无论如何,请通过谷歌搜索阅读,例如“经典的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)

#1


1  

Questioners are expected to try to fix their problem independently before asking. Your question doesn't really make any sense as you can't "convert" anything per se - so this will hardly help you.

在询问之前,询问者应该尝试独立解决问题。你的问题没有任何意义,因为你不能“转换”任何东西本身 - 所以这对你几乎没有帮助。

In any case, please read up by Googling, e.g. "classic asp database query", and you will find examples to get started such as:

无论如何,请通过谷歌搜索阅读,例如“经典的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)