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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong in that code ??

Status
Not open for further replies.

AlexRezid

Programmer
Jul 17, 2003
27
FR
I try this code for going to record X in a AccessDB using a web page...

But I don't know why, it works if I put it on an Access form, but it doesn't work any more in a web page

Could someone help ?

Code:
<SCRIPT language=vbs>
<!--
	Sub TestGo(Value As Integer)
        	Dim Record2 As New ADODB.Recordset
        	Dim i As Integer
        	Dim strsql As String
        
        	strsql = &quot;SELECT * FROM InfosClients&quot;
        	Record2.CursorLocation = adUseClient
        	Record2.Open strsql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
        	Record2.MoveFirst
        	Do While Not Record2.EOF And Not i = Value
        	    Record2.MoveNext
        	    i = i + 1
        	Loop
        	Set Me.Recordset = Record2
	End Sub
-->
</SCRIPT>

Thanks

Alex
 
I doubt a web page has &quot;CurrentProject.Connection&quot;. You might want to post vbscript questions in the VBScript forum.

Duane
MS Access MVP
 
Try something like this:

set cnn = CreateObject(&quot;ADODB.Connection&quot;)
set rst = CreateObject(&quot;ADODB.Recordset&quot;)

cnn.Open &quot;Provider=blah, blah, blah)
rst.Open &quot;Select...&quot;,cnn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top