🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #2893

come devo procedere?

#2893
From: albadur
Date: Thu, 26 Dec 2002 16:11
42 lines
1985 bytes
salve, io ho scritto una function che prendendo in ingresso una variavile
contenente un'istruzione sql dovrebbe connettersi al database utilizzando
ado, effettuare la query, e restituire il recordset relativo, � qualcosa del
genere:

Function recset(sql As String)

nomedb = App.Path & "\mdb\miodb.mdb"
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & nomedb & ";Persist
Security Info=False"
Set cn = New adodb.Connection
Set rs = New adodb.recordset
cn.Open strcn

rs.Open sql, cn, 3, 3
Set recset = rs

End Function

ma che sintassi devo utilizzare per richiamarla?

se faccio nel form

dim risultato as variant
sql = "select * from mia_tb"
risultato = recordset(sql)

'e lancio un ciclo while sul recordset

while not risultato.eof
'istruzioni
wend

mi dice
"propiet� o metodo non supportati dall'oggetto"
e mi indica sbagliata la riga del cilo while
xch� non me lo fa fare?
che cosa devo fare per far si che funzioni??

grazie

albadur
Technical Details
Message-ID: <6TFO9.25831$Q%4.801326@news1.tin.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,b625d611251520fb,start
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2002-12-26 08:11:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
From: "albadur" <albadur@tiscali.it>
Newsgroups: free.it.visual-basic
Subject: come devo procedere?
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <6TFO9.25831$Q%4.801326@news1.tin.it>
Date: Thu, 26 Dec 2002 16:11:46 GMT
NNTP-Posting-Host: 62.211.48.27
X-Complaints-To: newsmaster@tin.it
X-Trace: news1.tin.it 1040919106 62.211.48.27 (Thu, 26 Dec 2002 17:11:46 MET)
NNTP-Posting-Date: Thu, 26 Dec 2002 17:11:46 MET
Organization: TIN