Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To complete with my last work ...,

Status
Not open for further replies.

hercule2

Programmer
Nov 30, 2003
12
FR
To complete with my last work ..., i do this from web ASP page:

"Requete6" is an already existing request in database.

<%
Set appAccess = CreateObject(&quot;Access.Application&quot;)
appAccess.OpenCurrentDatabase &quot;base.mdb&quot;, False
Set db = appAccess.DBEngine.Workspaces(0).Databases(0)
Set QryDef = db.QueryDefs(&quot;Requête6&quot;)
QryDef.sql = &quot;Select TOP 5 MyFunc([field]) from table&quot;
appAccess.DoCmd.OpenQuery &quot;Requête6&quot;, acViewNormal, acReadOnly
appAccess.DoCmd.TransferText acExportHTML, , &quot;Requête6&quot;, &quot;c:\temp\x.html&quot;, False
QryDef.Close
Set QryDef = Nothing
%>


So, i can (under ACCESS 2000) by this unique way use this function MyFunc() but the result
is not easy to exploit from the file c:\temp\x.html.

Is it possible after &quot;DoCmd.OpenQuery&quot; to obtain the recordset like that ?

<%
Set m_Conn = server.CreateObject(&quot;ADODB.Connection&quot;)
m_Conn.Open &quot;eq14CVs&quot;, &quot;&quot;, &quot;&quot;
SQL = &quot;Select TOP 5 [field] as toto from table&quot; ' MyFunc is not permit here
Set rs = m_Conn.Execute(SQL)
Do
If (rs.EOF) Then Exit Do
response.write rs(&quot;toto&quot;) & &quot;<br>&quot;
rs.MoveNext
Loop
%>

I can't change my base in sqlserver.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top