Skip to content
Advertisement

Tag: oledb

How to terminate SQL statements when using DEFAULT value and OleDB?

Using C# and the JET OleDB driver (Microsoft.Jet.OLEDB.4.0) to connect to an old Access database (think Access 97). The following SQL statements work fine: But terminating the statement with a semi-colon (;) causes problems: Can SQL statements with DEFAULT be terminated? Answer Default values can (and probably should) be quoted using double quotes to avoid these errors, among others: Note

Data type for SQL aggregate functions (COUNT, SUM, AVG)

New to SQL. Say I run this query: This will return a single row with a field called “TotalSuppliers”. In my database, the result was “778”. When tested in C# using typeof, the type for this field was short (the ODBC SMALLINT or OleDB SmallInt data type). This matched the data type of the SupplierID column. Do I have control

Sql string with OLEDB gives error 1004 in VBA

I would like to import a text file into excel filtering just what I want through a VBA macro. When I use LIKE operator in the sql string I get the error 1004. I have tried both * and % as wildcard and ALike instead of Like but there is no difference. test_7.txt and the macro is: Answer SQL statements

Advertisement