I am trying to copy tables from MS Access to SQL Server and have an vbscript .hta. When I run this I get an error message that says "Unspecified Error" on the cmd.Execute line. Any ideas what is wrong here?
Code:
<!DOCTYPE html>
<html>
<TITLE>Access to SQL Short Version</TITLE>
<HEAD>
<HTA:APPLICATION
ID="AccessToSQLShortVersion"
APPLICATIONNAME="AccessToSQLShortVersion"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SCROLL="yes"
>
</HEAD>
<body>
<form name="F1" id="F1">
<table name="T1" id="T1">
<tr>
<td></td>
<input type=button name="Run" id="Run" onclick=ButtonPress1() value="Run"></input>
<td></td>
</tr>
<tr>
</table>
</form>
</body>
<script language="VBScript">
Sub ButtonPress1()
'Set Up Access Connection
set acccn = CreateObject("ADODB.Connection")
acccnstr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:/Documents and Settings/myname/My Documents/LIMA.TESTDB.mdb"
acccn.connectionString = acccnstr
acccn.Open
'msgbox "acccn open"
set sqlcn = CreateObject("ADODB.Connection")
sqlcnstr = "Provider=SQLOLEDB;Data Source=192.xxx.y.zz;Trusted_Connection=Yes;Initial Catalog=SQLSERVER_DB;User ID=ME;Password=THEM;"
sqlcn.ConnectionString = sqlcnstr
sqlcn.Open
'msgbox "tblcn open"
set cmd = CreateObject("ADODB.Command")
cmd.CommandType = 1
cmd.ActiveConnection = acccn
'msgbox "cmd created"
cmd.CommandText = "SELECT * INTO tblwGUIDSource IN '' " & sqlcnstr & " FROM tblwGUIDSource"
msgbox "about to execute command"
cmd.Execute
'acccn.ExecuteNonQuery()
set cmd = nothing
sqlcn.Close()
set sqlcn = nothing
acccn.Close()
set acccn = nothing
End Sub
</script>
</html>