What produces Error 10001 in vb6 at connection string? - vb6

After the last Windows/Office update Feb 2020 on some of the computers the following connection string in vb6 produces an
"Catastrophic Failure : (10001)"
ConnectionString = "provider=microsoft.ace.oledb.12.0;DataSource="+cMDBFile
After installing MicrosoftDatabaseEngine2010 (32bit) the error was gone, but only until the next Windows Restart/Windows Update.
After changing to
ConnectionString = "provider=microsoft.jet.oledb.4.0;DataSource="+cMDBFile
it seems to run.
My MDBFile Format is ACCESS2003
The connection is created as follows:
Dim objConn as ADODB.Connection
Set objConn = new ADODB.Connection
With objConn
.ConnectionString = "provider=microsoft.ace.oledb.12.0;DataSource="+cMDBFile
.Open
End With
The Error Occurs at .Open.
Does anybody know what happened?
The last years no error occurred (except 3420 in December of course).
Is this an error produced by Microsoft, if so, how can I tell them?

You connection string should according to your database type.
more likely when you are connection to mdb file, you should use
PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=

Related

ODBC Data Source Connection Successful but TNS Unresolved in VBScript

I am trying to make a connection to Oracle DB from VBScript. I've added all the environment variables and the code can locate the file of TNSNAMES.ora but cannot resolve the connection.
When I test the connectivity from the ODBC Data Source Administrator, I get a 'Success' result, but I still cannot access this from the code.
con.ConnectionString = "DSN=DATA;Uid=wh;Pwd=pwd;"
con.Open 'This is where it fails
I have tried many connection strings but all fail
OracleConnString = "Driver={Oracle in instantclient_18_3};server=server;database=db;trusted_connection=Yes;"
DB_CONN_STRING = "Driver={Oracle in instantclient_18_3}; " & _
"(DESCRIPTION=" & _
"(ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = port)" & _
"(CONNECT_DATA=(SERVICE_NAME=srv_name)))"
CONN_STRING = "CONNECT wh/pwd#//host/db"
How can I connect to the database from the script?
You mix several topics.
You hide the DSN name and the "Data Source Name", this makes it impossible for use to provide you the correct connection string.
If you like to use the ODBC DSN then the connection string must be
DSN=▇▇▇▇DATA;Uid=myUsername;Pwd=myPassword
However, you must create a System DSN, not a User DSN (see ODBC DSN). However, typically you don't use the ODBC DSN because you have to create the DSN on the target machine which is additional configuration work.
Connection string without DSN would be
Driver={Oracle in instantclient_18_3};Dbq=?????;Uid=myUsername;Pwd=myPassword;
or
Driver={Oracle in instantclient_18_3};Server=?????;Uid=myUsername;Pwd=myPassword;
see https://www.connectionstrings.com/oracle-in-oraclient11g_home1/
If you use full DB name like (DESCRIPTION=... then you don't need any tnsnames.ora file. The purpose of this file is to resolve an alias to this full DB name.
Ensure that the ODBC driver is the same architecture, i.e. 32-bit or 64-bit as your VBS environment.
Either use %windir%\system32\odbcad32.exe + %windir%\system32\cscript.exe
or %windir%\SysWOW64\odbcad32.exe + %windir%\SysWOW64\cscript.exe

Runtime error in VBScript for Excel

When I run a VBScript for excel sheet....
I get the unknown runtime error, code: 800A03EC.
I am stuck at the line
Do Until objExcel.cells(line,3).Value = ""
What could be the possible reason for getting such an error?

IIS 8 and Classic ASP client side debug

I've to activate the client side debug for a Classic ASP application running under IIS 8 in a Windows 2012 Server environment but I can't achieve that and every script error is returned to the browser as:
Server Error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed
regardless the settings I apply to ASP configuration section at web site and server side level in IIS 8 control panel.
Last configuration parameters I set were:
Calculate Line Numbers: True
Catch COM Component Exceptions: True
Enable Client-side Debugging: True
Enable Log Error Request: True
Enable Server-side Debugging: False
Log Errors to NT Log: False
Run On End Functions Anonymously: True
Script Error Message: An error occurred on the server ...
Send Errors To Browser: True
To test IIS behaviour I simply call this script:
<%# Language=VBScript %>
<%
a = 2
b = 3
c = a/b
response.write a & "/" b & "=" & c
%>
(note the missing "&" beteewn "/" and b)
getting the above mentioned 500 - Internal error.
The same code in an IIS 7.5 environment returns:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/test.asp, line 7
response.write a & "/" b & "=" & c
------------------------^
which is what I was looking for.
Can you help me to get the same with IIS 8.
Thank you.
Antonio

How to connect to remote msmq

I am unable to connect to remote msmq using the path name "computername\queue" I am getting error
"The queue path name specified is invalid.
I am using VB6
Dim oQInfo As MSMQ.MSMQQueueInfo
'Initialize the MSMQQueueInfo object.
Set oQInfo = New MSMQQueueInfo
oQInfo.PathName = "machine\acknakq"
oQInfo.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)

ADODB Connection Problem

I am trying to perform a database operation from a VB 6.0 application (connecting to SQL 2000). The application is running fine in my local and test machines, but it gives the following error in the UAT environment.
dbConn - Nothing
lErrorNum = -2147024770
sErrorDesc = Method '~' of object '~' failed
My source code is:
Dim connectionString As String
connectionString = "DSN = {My DSN Name}"
Private dbConn As ADODB.Connection
Set dbConn = New ADODB.Connection
With dbConn
.ConnectionString = sConn
.ConnectionTimeout = 10
.CursorLocation = adUseClient
.CommandTimeout = 60
.Open
End With
The MDAC version is MDAC 2.8 SP2 ON WINDOWS SERVER 2003 SP1. (Check with CompChecker)
I have copied the source code to the UAT environment and tried running it from the IDE, but still the same error.
One possibility is that you need to install the MS SQL Client tools on the UAT server (http://msdn.microsoft.com/en-us/library/aa197918(SQL.80).aspx). Have you checked the DSN itself using the test connection option? You could also try an DSN-less connection string.
The error code is a Win32 facility error, 123 ERROR_INVALID_NAME: The file, directory name, or volume label syntax is incorrect.
Sounds like ADO isn't installed correctly.

Resources