2012-10-05 148 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