Thursday, March 22, 2012
Connectivity between vb 6.0 and Sql server 2000 (data base is in Server)
I am sudhir
I am facing problem to establish connection between vb 6.0 and ms sql
server 2000, ie data base is in Server. I want to make conneciton
between them.
please help me.
Advance thank you alll
' Basic ADO
Dim strConnectionString as String
Dim myConn as ADODB.Connection
Dim myRS as ADODB.Recordset
' This uses the SA username, but you can create / use another
strConnectionString = "Provider=SQLOLEDB.1;Password=MySAPassword;Dat a
Source=MyServerName;User ID=SA;Initial Catalog=MyDBName;"
Set myConn = New ADODB.Connection
myConn.Open strConnectionString
set myRS = myConn.Execute "SELECT MyCol From MyTable"
If not myRS.EOF then
myRS.MoveFirst
While Not myRS.EOF
' Read stuff out of the recordset
Msgbox mrRS!MyCol
mrRS.MoveNext
Wend
End If
Jamie Clancy
Ulysses Systems, London
"sudhir9992003@.gmail.com" wrote:
> Hai all
> I am sudhir
> I am facing problem to establish connection between vb 6.0 and ms sql
> server 2000, ie data base is in Server. I want to make conneciton
> between them.
> please help me.
> Advance thank you alll
>
Tuesday, February 14, 2012
Connection Reset
I have build an application on top of SQL Server 2005 and i am using microsoft driver. My application stops periodically becoz of Database Connection Loss and I get the following exception
com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.transmit operation. Exception:Socket closed. Context:(5) [Thread[Thread-55,5,main], IO:7e2dc, Dbc:null].
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDriverError(Unknown Source)
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.DBComms.transmit(Unkn own Source)
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.IOBuffer.sendCommand( Unknown Source)
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.SQLServerStatement.se ndExecute(Unknown Source)
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.SQLServerStatement.do ExecuteQuery(Unknown Source)
10:06:14:703 AM at com.microsoft.sqlserver.jdbc.SQLServerPreparedStat ement.executeQuery(Unknown Source)
Unable to find the exact reason for the above problem. Pl advice
Thanks & Rgds
RoshiniIt apppears to me that you get some kind of timeout, and the connection is closed, but I might be proven wrong. Nevertheless, you should handle such cases, as this may happen even in the most critical high availability solutions, for instance if a SQL Server Cluster is failing over. Applications should be able to reconnect automagically.
Friday, February 10, 2012
Connection Problem with the Workstation
I am trying to replicate our database by using the merge replication.
>From server side I tried to connect to the workstation. I have
installed MSDE to the client machine. I can see the machine name on the
SQL Server Group however I wasnt able to create the conncetion between
the machines. I have checked my network connection, there is no problem
I can see the machine and I can connect it through the network. I tried
to use Client Network Utility with Named Pipes and TCP/IP but not a
good news. I couldnt achieve to connect to the machine. So could
someone please help me out with this problem. I am really in trouble I
have to find out this end of this week.
Regards
As"laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1104862206.970118.48710@.c13g2000cwb.googlegro ups.com...
> Hi all;
> I am trying to replicate our database by using the merge replication.
>>From server side I tried to connect to the workstation. I have
> installed MSDE to the client machine. I can see the machine name on the
> SQL Server Group however I wasnt able to create the conncetion between
> the machines. I have checked my network connection, there is no problem
> I can see the machine and I can connect it through the network. I tried
> to use Client Network Utility with Named Pipes and TCP/IP but not a
> good news. I couldnt achieve to connect to the machine. So could
> someone please help me out with this problem. I am really in trouble I
> have to find out this end of this week.
> Regards
> As
You don't mention your version of MSDE, but network access is disabled in
MSDE 2000 SP3a:
http://support.microsoft.com/kb/814130
Simon|||yeah I have installed 2000 SP3a then should I install SQL2000 client
version to my workstation?|||"laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1104873576.019320.324770@.z14g2000cwz.googlegr oups.com...
> yeah I have installed 2000 SP3a then should I install SQL2000 client
> version to my workstation?
If you have MSDE 2000 SP3a, then by default you cannot access it from the
network, so that is probably why you cannot connect to the MSDE installation
on your workstation from your server (if I understood your problem
correctly). As mentioned in the KB article, you can use the MSSQL network
utility to enable network support, and then you should be able to connect to
MSDE from other computers.
Simon
Connection problem OSQL - MSDE
I have recently installed MSDE to use with
a trial version of Visual Studio .NET 2003
I installed MSDE 2000 release A with the following command:
Setup.exe /qb+ INSTANCENAME=3D"NetSDK" DISABLENETWORKPROTOCOLS=3D1
SAPWD=3D"notthisone"
I now have to install a database to be used in exercises
that is installed through a bat file:
rem The following command line installs the Contact SQL database
osql -E -i InstContacts.Sql
osql.exe refused to connect with sqlserver. It should communicate
using shared memory but that fails.I have enabled tcp/ip and named
pipes (which are disabled by default) using the Server Network Utility
but that did not work either. It usually fails with the following
messages:
[Shared Memory]SQL Server does not exist or access denied.
[Shared Memory]ConnectionOpen (Connect()).
With tcpip enabled it gives the messages
[Shared Memory]Invalid connection.
[Shared Memory]ConnectionOpen (Invalid Instance()).
after running ther TDIMON utility (www.sysinternals.org)
I get the first error message,
TDIMON seems to screw up some tcpip related settings as I encounter
other problems connecting with ADSL with a ethernet card.
(Could this be causing confusion for OSQL?)
The messages suggest to me that it is using shared memory also
when TCPIP is available.
I have no control over the communications by OSQL,
there seem to be no switches to control it.
I tried several solutions I found in this group and on
a Microsoft site, but none worked so far.
I have one named instance NETSDK of SQL server (desktop engine)
I am running Windows 2000 with
Norton Internet Security 2002
computer/instance=3DSTARSHIP\NETSDK
instance name=3DMSSQL$NETSDK
some version info: 'SSNETLIB.DLL' version '8.0.766'.
I think I have MDAC 2.7 when looking in the registry
Does anyone has an idea what is wrong?
Martin Kramer
mkramer@.wxs.nl
http://home.wxs.nl/~mkramer/
hi Martin,
Martin Kramer wrote:
> rem The following command line installs the Contact SQL database
> osql -E -i InstContacts.Sql
please add the full instance name ...
osql -E -S(Local)\NetSDK -i InstContacts.Sql
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.12.0 - DbaMgr ver 0.58.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote:
>hi Martin,
>Martin Kramer wrote:
>please add the full instance name ...
>osql -E -S(Local)\NetSDK -i InstContacts.Sql
Thanks a lot
It certainly worked much bettert than anything I tried
There is a database created. I only have doubts about the
access rights for the ASPNET user that the selfstudy samples use.
But this was syntax from microsoft. It should have worked
as it came with the samples. Or has anything gone wrong
initially when osql searches for a database server?
There is only one on my system.
I copied the original bat file to a new one,
adding a pause statement to see the feedback,
because the original flashed away before I could have a look at it.
It seems the problem was not with TCPIP after all,
However, I can not get osql into a command promt mode with
the same syntax. Is that possible and if so, how.
Oracle and DB2 had similar functions.
Or is osql not intended/suitable for such use?
Martin Kramer
mkramer@.wxs.nl
http://home.wxs.nl/~mkramer/
|||hi Martin,
Martin Kramer wrote:
> But this was syntax from microsoft. It should have worked
> as it came with the samples. Or has anything gone wrong
> initially when osql searches for a database server?
> There is only one on my system.
without specifying the destination server, the (Local) server is assumed,
but as long you installed a named instance you have to full qualify it..
> I copied the original bat file to a new one,
> adding a pause statement to see the feedback,
> because the original flashed away before I could have a look at it.
> It seems the problem was not with TCPIP after all,
Shared Memory is used instead of network protocol(s) to connect to local
server..
> However, I can not get osql into a command promt mode with
> the same syntax. Is that possible and if so, how.
> Oracle and DB2 had similar functions.
> Or is osql not intended/suitable for such use?
are you using the one I proposed?
http://msdn.microsoft.com/library/de..._osql_1wxl.asp
http://support.microsoft.com/default...;EN-US;q325003
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.12.0 - DbaMgr ver 0.58.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote:
>hi Martin,
>Martin Kramer wrote:
>without specifying the destination server, the (Local) server is =
assumed,=20
>but as long you installed a named instance you have to full qualify it..
I understand. Having a named instance requires specifying it.
>
>Shared Memory is used instead of network protocol(s) to connect to local=
=20
>server..
OK. Seems logical as it should be efficient.
>
>are you using the one I proposed?
>http://msdn.microsoft.com/library/de...y/en-us/copro=
mpt/cp_osql_1wxl.asp
>http://support.microsoft.com/default...;EN-US;q325003
I don't understand this question, as you are proposing it only now,
but I found the links very helpful and now have osql.exe running in
command promt mode so I can try all kinds of commands.
This was what I was looking for.
You have been very helpful
Thank you.
Martin Kramer