Re: Could not convert variant of type (Null) into type (String)

From: Viatcheslav V. Vassiliev (support_at_oledbdirect.com)
Date: 02/27/05


Date: Sun, 27 Feb 2005 22:56:54 +0300

Driver should be "SQL Server", not "SQLOLEDB" as you wrote - at least I can
not connect to MS SQL Server with DRIVER=SQLOLEDB.

DRIVER=SQL Server;SERVER=(local);DATABASE=pubs

This connection string works. But in this case you use OLEDB provider for
ODBC and ODBC driver for MS SQL Server. Connection string I shown uses
native OLEDB provider for MS SQL Server. You may find many posts in this
newsgroup why you should not use ODBC driver with ADO and specially MS SQL
Server. For example, in this thread.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

<lotemlotad@yahoo.com> сообщил/сообщила в новостях следующее:
news:4221e5c2@newsgroups.borland.com...
> Actualy i use this connection string when i work in
> D6 with MSSQL and ADO.
> If this is a the wrong string i will use yours but it seem to work well.
>
> Barak
>
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> news:4221a948@newsgroups.borland.com...
>> This one may work only in .Net for SqlConnection (without
> Driver=SQLOLEDB).
>> ADO uses another connection string:
>>
>> Provider=SQLOLEDB;Data Source=<Server>;Integrated Security=SSPI;Initial
>> Catalog=<Database>
>>
>> //------------------------------------------
>> Regards,
>> Vassiliev V. V.
>> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
>> ADO.Net
>> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
>> MS Jet (Access) and Interbase (through OLEDB)
>>
>>
>> <lotemlotad@yahoo.com> сообщил/сообщила в новостях следующее:
>> news:422190a9$1@newsgroups.borland.com...
>> > Why can't you build the AdoConnection string?
>> > I use
>> > AdoConnection.ConnectionString :=
>> >
> 'Driver=SQLOLEDB;Server=Server;Database=Database_Name;Trusted_Connection=yes
>> > ;';
>> >
>> > And it work well.
>> >
>> > "zorba" <tjall@buziaczek.pl> wrote in message
>> > news:421f0687@newsgroups.borland.com...
>> >> >
>> >> >>I connect with SQL Server(MSDE) database using ADO(Microsoft OLE DB
>> >> >>Provider for ODBC Drivers).Durnig compilation occured exception
> "Could
>> >> >>not convert variant of type (Null) into type (String)". What's
> causing
>> >> >>that problem?
>> >> >Using ODBC when you should be using the OleDB provider for SQL Server
>> >> >--
>> >> >Brian Bushay (TeamB)
>> >> >Bbushay@NMPLS.com
>> >> >
>> >>
>> >> If I choose OleDB provider for SQL then I can't build ADOConnection
>> >> String ... server doesn't exists ... probably I try to switch on
>> >> Firebird :)
>> >>
>> >>
>> >>
>> >> --- posted by geoForum on http://delphi.newswhat.com
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: Is PERL --> MS SQL really that difficult?
    ... You haven't got the money for a commercial solution but if you had tried OOB or our sql server driver they would have checked your Perl was OK, checked DBI and DBD::ODBC was installed, created a unixODBC/OOB data source which connected to your actual SQL Server, demonstrated data coming back through isql and through Perl and shown you the DBI connection string to use. ...
    (perl.dbi.users)
  • Re: One Connection String for Multiple Users (SQL)
    ... Hitchhiker’s Guide to Visual Studio and SQL Server ... "William Vaughn" wrote: ... This uses the> same connection string for all instances of the application. ...
    (microsoft.public.sqlserver.connect)
  • Re: Accessing a SQL Server Database from a Perl Script on Linux
    ... > and not the Windows machine which has the SQL server on it. ... > For a Perl program running on a Linux box to query a SQL Server ... turn talks with SQL Server through an ODBC driver on the Windows side. ...
    (comp.lang.perl.misc)
  • Re: Accessing a SQL Server Database from a Perl Script on Linux
    ... > and not the Windows machine which has the SQL server on it. ... > For a Perl program running on a Linux box to query a SQL Server ... turn talks with SQL Server through an ODBC driver on the Windows side. ...
    (comp.os.linux.questions)
  • Re: Is PERL --> MS SQL really that difficult?
    ... information from an MS SQL server insanely difficult? ... You haven't got the money for a commercial solution but if you had tried OOB or our sql server driver they would have checked your Perl was OK, checked DBI and DBD::ODBC was installed, created a unixODBC/OOB data source which connected to your actual SQL Server, demonstrated data coming back through isql and through Perl and shown you the DBI connection string to use. ...
    (perl.dbi.users)