Vb6 Adodb error codes with equivalent nativeerror - com

I need to know the list of Visual Basic 6 error codes returned by ADODB SQL Server connection. I also want to know the Err.Nativeerror for each SQL ADODB error code.
Any information about where we can get these errors codes or any VB6 codes which list the exceptions and error codes with descriptions of the error details and what the errors mean.

A table of the ADODB error codes with brief descriptions are located at ADO Programmer's Reference > ADO API Reference > ADO Enumerated Constants.
There is a note:
OLE DB errors may be passed to your ADO application. Typically, these
can be identified by a Windows facility code of 4. For example,
0x8004.
Also to determine if an HRESULT error code is an ADODB error, this additional note indicates:
Hexadecimal—The hexadecimal representation of the full error number.
The Windows facility code is in the fourth digit. The facility code
for ADO error numbers is A. For example: 0x800A0E7B.
See also [MS-ERREF]: Windows Error Codes from Microsoft which has a link to a pdf of a document from Microsoft with a fairly comprehensive list of codes and their descriptions. There is an RSS feed to subscribe for notifications of updates.
See as well as very comprehensive list of Error Codes list for Microsoft technologies from Symantech.
See this Wikipedia topic HRESULT describing the error code format used by Microsoft for HRESULT error codes. From the topic the format as to how bits are used is:
S - Severity - indicates success/fail
0 - Success
1 - Failure
R - Reserved portion of the facility code, corresponds to NT's second severity bit.
1 - Severe Failure
C - Customer. This bit specifies if the value is customer-defined or Microsoft-defined.
0 - Microsoft-defined
1 - Customer-defined
N - Reserved portion of the facility code. Used to indicate a mapped NT status value.
X - Reserved portion of the facility code. Reserved for internal use. Used to indicate HRESULT values that are not status values, but are instead message ids for display strings.
Facility - indicates the system service that is responsible for the error. Example facility codes are shown below (for the full list see [1]).
1 - RPC
2 - Dispatch (COM dispatch)
3 - Storage (OLE storage)
4 - ITF (COM/OLE Interface management)
7 - Win32 (raw Win32 error codes)
8 - Windows
9 - SSPI
10 - Control
11 - CERT (Client or server certificate)
...
Code - is the facility's status code
The ITF facility code has subsequently been recycled as the range in which COM components can define their own component-specific error code.
A few of the more common codes are:
adErrItemNotFound - -2146825023 or 0x800A0CC1 - Item cannot be found in the collection that corresponds to the requested name or ordinal.
adErrNoCurrentRecord - -2146825267 or 0x800A0BCD - Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
adErrObjectNotSet - -2146824868 or 0x800A0D5C - Object is no longer valid.
One programmer error that I have done myself which resulted in an HRESULT of 0x800A0CC1 when doing an Update() is that the I did not have my SAFEARRAY setup properly. See usage differences between _variant_t, COleVariant, CComVariant, and VARIANT and using SAFEARRAY variations.

Related

Cisco AXL Error Codes - Access to documentation, database table, etc

I found some AXL Error Codes, 5000 - 5007 (5006 missing), but there have to be more.
For example I also received a -239.
Is there a documentation on the AXL Error Codes?
Perhaps there is a database table containing the AXL Error Codes.
Like the database tables from Cisco Unified Communications Manager 12.5(1) Database Dictionary:
https://developer.cisco.com/docs/axl/#!12-5-cucm-data-dictionary
There are tables like
typeadminerror
typedberrors
containing error codes and messages, but none for the AXL Error Codes (like mention above, 5000 - 5007, -239).
Where are those AXL Error Codes defined, and the messages?
The AXL error codes are not documented and may change per release (though very unlikely to see anything but additions), but may be useful when working with Cisco Developer Support.
Examining the AXL service logs on CUCM may provide some clues for the errors as you encounter them.

HSTMT, UCHAR, SDWORD meaning in ODBC Log

I have the following lines in my ODBC Log :
(Scenario: pgAdmin4, using PostgreSQL server through ODBC32 in another application named System Administration)
System Admi 6a0-6f8 ENTER SQLExecDirect
HSTMT 0x00630718
UCHAR * 0x036B29C0 [ 63] "create table new (npages integer, ifnds integer, ifnid integer)"
SDWORD 63
I need to know the meaning of HSTMT, UCHAR* and SDWORD. What do those numbers next to them mean ?
From the article Everything You Want To Know About ODBC Tracing
In the trace log, you’ll see the data type of the handle being
SQLHANDLE, HENV / SQLHENV, HDBC / SQLHDBC, HSTMT / SQLHSTMT. This
value is unique to the particular series of items being called. You
can search in the trace log for this handle number and each call made
on the handle will be shown. This allows you to pick out only the
calls in the trace log that are relevant to your error message. Keep
in mind, some applications may create multiple handles. For example,
your application may execute three statements consecutively with each
residing on a different statement handle.
For examples and more details follow the next nice document:-
How to read an ODBC trace file.rtf
This is a record of ODBC tracing
There was a procedure "SQLExecDirect" with statement handle 0x00630718, text parameter (passed as pointer) is "create table ..." and last parameter is size of text (passed as word type). See related reply in MSDOC.
HSTMT,UCHAR, SDWORDS are data types used by C, C++ MS Windows API.

Importing data from multi-value D3 database into SQL issues

Trying to use the mv.NET by bluefinity tools. Made some integration packages with it for importing data from a d3 multi-value database into MS SQL 2012 but seem to be having some trouble with the mapping.
For the VOYAGES table have some commentX fields in the D3 application that are acting quite unwieldy and the INSERT fails after a certain number of rows with the following message
>Error: 0xC0047062 at INSERT, mvNET Source[354]: System.Exception: Error #8: dataReader[0] = LTPAC002 ci.BufferColumnIndex = 52, ci.ColumnName = COMMGROUP(Error #8: dataReader[0] = LTPAC002 ci.BufferColumnIndex = 52, ci.ColumnName = COMMGROUP(The value is too large to fit in the column data area of the buffer.))
at mvNETDataSource.mvNETSource.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)
Error: 0xC0047038 at INSERT, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.The PrimeOutput method on mvNET Source returned error code 0x80131500.The component returned a failure code when the pipeline engine called PrimeOutput().The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.There may be error messages posted before this with more information about the failure.
The value is too large to fit in the column data area of the buffer. -> tried changing the input / outputs types but can't seem to get it right.
In the SQL table the columns are of type ntext.
In the .dtsx job the data type for the columns are of type Unicode String [DT_WSTR] with length 4000 , I guess these are auto-detected.
The import worked for other D3 files like this not sure why it fails for these comment fields.
Running the query on the mv.NET Data Manager ( on the d3 server) times out after 240 seconds so maybe this is the underlying issue?
Any ideas how to proceed? Thank you ~
Most like reason is column COMMGROUP does not have correct data type or some record in source do not fit in output type
To find error record (causing) you have to use on redirect row (property of component failing component ) and get the result set in some txt.csv /or tsv file .
then check data
The exception is being thrown from mv.NET so I suggest you call (or ask your reseller) to call Bluefinity support and ask them about this. You're paying for support, might as well use it. Those programs shouldn't be allowed to throw exceptions like that.
D3 doesn't export Unicode, that might be one issue. But if the Data Manager times-out then I suspect something is wrong in the connectivity into D3. Open a Connection Monitor from the Session Monitor and watch the connection when you make the request. I'm guessing it's either hanging or more probably it's falling into BASIC Debug.
Make sure all D3-side programs related to this are either all Flash-compiled, or all Not Flashed. Your app code will fall into Debug if it's not Flashed but MVNET.BP is.
If it's your program that's in Debug, fix it. If you're not sure which program it is, LIST-RUNTIME-ERRORS in DM.
If it's a MVNET.BP program, again work with Bluefinity. If you are using MVSP for connectivity then the Connection Monitor may be useless, you'll need to change that to an IP (Telnet) connection to see the raw data exchange.

SQL STATE 37000 [Microsoft][ODBC Microsoft Access Driver] Syntax Error or Access Violation

Good day!
I get this error:
SQL STATE 37000 [Microsoft][ODBC Microsoft Access Driver] Syntax Error
or Access Violation, when trying to run an embedded SQL statement on
Powerscript.
I am using MsSQL Server 2008 and PowerBuilder 10.5, the OS is Windows 7. I was able to determine one of the queries that is causing the problem:
SELECT top 1 CONVERT(DATETIME,:ls_datetime)
into :ldtme_datetime
from employee_information
USING SQLCA;
if SQLCA.SQLCODE = -1 then
Messagebox('SQL ERROR',SQLCA.SQLERRTEXT)
return -1
end if
I was able to come up with a solution to this by just using the datetime() function of PowerBuilder. But there are other parts of the program that is causing this and I am having a hard time in identifying which part of the program causes this. I find this very weird because I am running the same scripts here in my dev-pc with no problems at all, but when trying to run the program on my client's workstation I am getting this error. I haven't found any differences in the workstation and my dev-pc. I also tried following the instructions here, but the problem still occurs.
UPDATE: I was able to identify the other script that is causing the problem:
/////////////////////////////////////////////////////////////////////////////
// f_datediff
// Computes the time difference (in number of minutes) between adtme_datefrom and adtme_dateto
////////////////////////////
decimal ld_time_diff
SELECT top 1 DATEDIFF(MINUTE,:adtme_datefrom,:adtme_dateto)
into :ld_time_diff
FROM EMPLOYEE_INFORMATION
USING SQLCA;
if SQLCA.SQLCODE = -1 then
Messagebox('SQL ERROR',SQLCA.SQLERRTEXT)
return -1
end if
return ld_time_diff
Seems like passing datetime variables causes the error above. Other scripts are working fine.
Create a transaction user object inherited trom transaction.
Put logic in the sqlpreview of your object to capture and log the sql statement being sent to the db.
Instantiate it, connect to the db, and use it in your embedded sql.
Assuming the user gets the error you can then check what was being sent to the db and go from there.
The error in your first statement should be the second parameter to CONVERT function.
It's type is not a string, it's type is an valid expression
https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql
So I would expect that your
CONVERT(DATETIME,:ls_datetime)
would evaluate to
CONVERT(DATETIME, 'ls_datetime')
but it should be
CONVERT(DATETIME, DateTimeColumn)
The error in your second statement could be that you're providing an wrong datetime format.
So please check if your error still occurs when you use this function
https://learn.microsoft.com/en-us/sql/t-sql/statements/set-dateformat-transact-sql
with the correct datetime format you're using

Method 'add' in COM object of class 'Documents' returned error code 0x800A175D (<unknown>) which means: <unknown>

I am trying to open word Template from AX 2012 Reports. It works fine in the env I have developed but when I try to execute the same from different login I face the "COM error"
Please help.
You can always find help for these mysterious Office error codes by decoding the error code. COM error codes contain three major parts:
the top 4 bits indicate the severity of the error. 8 means "warning", one you can't ignore
the next 12 bits is the facility code, the origin of the error. 10 means "automation"
the lower 16 bits is the internal error code, the one that you really care about.
Switch your calculator to hex mode, 0x175d is error code 5981. Now turn to Google and query "word error 5981".
Lots of good hits, you can read them at your leisure. But clearly there's a problem with macros on that machine. Best left to the IT staff at your site, use superuser.com if you need more help with that.