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

HTA using ADODB Error

Status
Not open for further replies.

EBGreen

Programmer
Apr 1, 2004
2,867
US
Why is this code giving me these errors:
Error:
Line:26
Syntaxt Error

Then when I try to debug:
An exception 'Runtime Error' has occurred in Script.

However, no debuggers are registered that can debug this exception. Unable to JIT debug.

This is the code:
Code:
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" Content="Microsoft Visual Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8">
<script id=clientEventHandlersVBS language=vbscript>
<!--

Sub btnPrep_onclick
	Dim oAccess
	Dim oImportDB
	Dim oExportDB
	Dim strConn
	Dim oConn
	Dim rs
	Dim strSQL
	MsgBox "Start"	
	On Error Resume Next
	
	strConn = "DBQ=H:\Data\MyScripts\_IWrote\PrepareImport\darden.mdb;DRIVER={Microsoft Access Driver (*.mdb)};"
	Set oConn = CreateObject("ADODB.Connection")
	MsgBox "Conn: " & Err.Description 
	oConn.Open strConn
	MsgBox "OpenConn: " & Err.Description
	Set rs = CreateObject("ADODB.Recordset")
	MsgBox "rs: " & Err.Description
	strSQL = Select * FROM tblContactList"
	rs.Open strSQL, oConn
	If rs.EOF Then
		MsgBox "No Records"
	Else
		Do While Not rs.EOF
			MsgBox rs("Id")
			rs.MoveNext
		Loop
	End If
	
	rs.close
	Set rs = Nothing
	oConn.Close
	Set oConn = Nothing
	
	
End Sub

-->
</script>
</HEAD>
<BODY>

<!-- Insert HTML here -->
 <input id=btnPrep type=button value="Prepare for Import">

</BODY>
</HTML>
 
Replace this:
strSQL = Select * FROM tblContactList"
By this:
strSQL = [highlight]"[/highlight]Select * FROM tblContactList"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I hate it when I can't see things like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top