Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Tuesday, March 27, 2012

Connecting to SQL Server (Local Machine)

Hi all,

Apologies if this is a dumb question, but I'm tearing my hair out over the basics when I should be spending time learning ASP.NET 2.0 and C#. I've searched the archives and a lot of people seem to be getting the same error as me, but when trying to connect from remote machines.

I'm getting what seems to be a standard message ...

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I'm not trying to connect remotely, I'm on my developer machine. The error comes up when trying to connect from within VS2005 (Tools, Connect to Database). It also comes up if I create a new web-site and go to the ASP.NET configuration tool (this is, I guess, trying to create the necessary database behind the scenes but is unable to connect to the database).

I suspect the error might be related to one or more of the following ...

September last year I installed VS2005 Express and SQL*SERVER Express. Both were fully un-installed when I bought VS2005 Professional before installing the new product.

When I set up SQL*SERVER 2005 Developer I remember choosing an option to have a separate user on my PC with administrative rights. Actually I don't recall much about what I chose but I can't find out where those permissions are managed from.

I've followed various instructions to check that remote access is enabled (despite the fact that I'm local, not remote). TCP and Named Pipes are both enabled (and I stopped then restarted SQL Server). I've checked that the service is started.

The odd thing is that I have had an application connect with the following string ...

SSLCon = new SqlConnection(@."Server=(local)\SSLMJ;Integrated Security = True;" + "Database=SSLTESTRESULTS");

Though the application connection seems to work ok, I think I'm missing out lots of developer functionality because I can't get VS2005 to see the database or server.

Help ?

Further info ...

I found and checked my machine.config file which has the following section ...

<connectionStrings>

<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

</connectionStrings>

Could the reference to SQLEXPRESS be causing my problem ? How do I correct this ?

|||Tried commenting out the line beginning <add, but no effect.|||If you are connecting to the Express Edition instance on the same machine as it is running, you do NOT need to configure remote connections. Take a look at your services and see if the SQL Browser service is running. If it isn't running, start the service and try connecting again.|||

Thanks Michael. Using the Surface Area tool I've checked that the database engine and broswer are both running. Agent is not running. Remote Connections are set to both local and remote using both TCP and Named Pipes. However, I'm connecting locally (or trying to).

I'm using SQL Server 2005, not Express.

I don't understand why my application code can connect, but VS2005 can't ?

|||

Sorted - though I don't know why this worked.

Without changing any setup info ...

- went to configure my SqlDataSource as normal

- Instead of expanding the listbox for "Server Name" and finding it empty I typed the fully qualified name "MICKSPC\SSLMJ"

- expanded the list of database names - there they were !

I'd still like to know why VS couldn't find my server ? Any ideas ? "MicksPC" is there in Server Explorer. Expanding it shows the following ...

- Crystal Reports Services

- Event Logs

- Management Classes

- Management Events

- Message Queues

- Performance Counters

- Services

Under services is listed "SQL Server (SSLMJ)" and the properties for that service show it is running with a service name of MSSQL$SSLMJ.

Thursday, March 22, 2012

Connecting to remote SQL server problems

I'm trying to run a report in VB 6 and having a heck of a time. I think my major problem right now is that it doesn't know where I'm trying to connect to and with which credentials. I've looked thru k.babu's sticky thread, but haven't found a solution.

Here is the code I have right now:

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault
With Report
.ParameterFields(1).ClearCurrentValueAndRange
.ParameterFields(1).AddCurrentValue "KL"
.Database.LogOnServer "p2ssql.dll", "tsg2170", "tableName", "username", "password"
End With
CRViewer1.ViewReport
End Sub

I don't have a clue what to do. BTW, this is my first attempt at anything with crystal in VB.

The error I'm getting is:
Login Failed.
Details: ADO error code: 0x80040e4d
Source: Microsoft OLE DB Provider for SQL Server
Description: Login failed for user 'username'.
SQL State: 42000
Native Error: 18456

I know the username/password are correct.Here is my solution

Private Sub Form_Load()
Dim CRXReport As CRAXDDRT.Report
Dim CRXDb As CRAXDDRT.Database
Dim CRXTbl As CRAXDDRT.DatabaseTable
Dim init As Integer

Set CRXReport = Report
Set CRXDb = CRXReport.Database

CRXReport.DiscardSavedData

init = 1
Do Until init = CRXReport.Database.Tables.Count + 1
CRXReport.Database.Tables.Item(init).SetLogOnInfo "tsg2107", "sedonaMM", "username", "password"
init = init + 1
Loop

With frmMain
.Show
CRXReport.ParameterFields(1).AddCurrentValue "LH"
With CRXReport
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = "C:\LHReport.pdf"
.ExportOptions.FormatType = crEFTPortableDocFormat
End With
.CRViewer1.ReportSource = CRXReport
CRXReport.Export False
End With

Set CRXReport = Nothing
End Sub

Connecting to Remote SQL server - time out expired?

Hello

Im connecting to a remote SQL Server in Enterprise Manager Via VPN,

we checked the connection and everything but still o cant connect

to the remote server, Error message says "Time Out Expired",

we checked the firewall config, ADSL connection and it's all Ok

what seems to be the problem here??Hello

Im connecting to a remote SQL Server in Enterprise Manager Via VPN,

we checked the connection and everything but still o cant connect

to the remote server, Error message says "Time Out Expired",

we checked the firewall config, ADSL connection and it's all Ok

what seems to be the problem here??

There are oh so many possibilities...

1. Can you telnet to the remote server on the correct port?
2. Is there another firewall at the other end (I assume so since it's a VPN)? If so, can you verify that the traffic is getting beyond that firewall?
3. Are both firewalls set to handle the "hand-off" that occurs when incoming traffic on port 1433 is handed off to a negotiated port? This is usually automatic, but on some older firewalls, it must be manually configured.
4. Are you using hostname or IP address to connect? If hostname, what is the name resolution service running (I assume DNS)? If DNS, are you sure about the IP Address resolution?
5. Are you NAT'ing the internal IP addresses? Are the NATs configured correctly.

Look at your firewall logs carefully (hopefully there's a nice GUI to help you). The answer is likely in there somewhere. It may not be easy to find, but it's in there.

Regards,

hmscott

Tuesday, March 20, 2012

Connecting to Oracle from Windows 64bit IA server

I am trying to pull data from an Oracle 9i database to my SQL Server 2005 sp1 database on Windows 2003 64bit Itanium server. Each time I try to use the import wizard, select the Microsoft OLE DB driver for Oracle, I get an error message telling me that the Oracle client tools are not installed. This happened after I had already installed the 9i tools, tested the connection using TNSPING and confirmed the tnsnames file was correct. So, I uninstalled the 9i tools and then installed the 10g client tools. Tested everything after the install and then tried the import again selecting the MS OLE DB driver for Oracle. I again got the error message that the Oracle tools were not installed.

has anyone ran into this problem and if so, were you able to fix it?

It seems that there is an with how Oracle parses the Program Files (x86) directory. Has anyone heard of this?|||

This is a known Oracle bug, with plenty of information about the issue here -

Connecting to Oracle on 64-bit (x64) machine - MSDN Forums
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=159581&SiteID=1)

sqlsql

Connecting to Oracle Datasource for import

Now this is the first time i have tried this with SQL 05 I am trying to Import data from an Oracle DB. I have the connection info:

Xtx20xxx = (DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =urlpart1.part2.part3.com)(PORT = 1521)))(CONNECT_DATA =(SID = Xtx20xxx ))
)

I used the Microsoft OLEDB provider for oracle from the dropdown,

The username and password I have also. I tried to enter in the Xtx20xxx as the server name, clicked "Properties"

put in the username and password I can given and clicked "Test Connection". No matter what I get the infamous ORA-12154: TNS:could not resolve service name error message. I am sure I am missing something obvious here but I have absolutely no clue and all the googling in the world has not given me any help. I do have the Oracle 10g client tools installed on this workstation (running Windows XP Prof SP2 and SQL 2005 STD).

Make sure the server name is in your tnsnames.ora file.

http://www.dba-oracle.com/tips_oracle_tnsnames_ora_file.htm

|||

Alright...so being a Oracle newbie, I found I did not properly install all the client software so as you suggested I did not even have a .ora file anywhere on my machine. I went through a better install which brought up a java app that asked me all the questions and built an ora file.

So now I am on to a Login issue (invalid username/password).

|||Can you mark this post as answered please? sqlsql

Thursday, March 8, 2012

Connecting to Access2000 database at runtime from VB

Hi,

I want to connect to Crystal reports from VB.I am using CR ver 8.5 The database should be set at runtime instead of design time so that where ever I place my application the report should work from that directory (it could be d:\ or e:\ or N:\). The path should not be hardcoded in the report where we give the set location path. plssss help me out, this is very urgent

venkyHi Venky,
See if this will help:
http://www.dev-archive.com/forum/showthread.php?t=337289|||strDBPath = App.Path & "\CTS.mdb"
Set conRep = conAPP.OpenReport(App.Path & "\reports\PCCost.rpt", 1)
Set crxDatafiles = conRep.Database.Tables
crxDatafiles(1).SetLogOnInfo (strDBPath)

but still i am getting the error "File could not be found" "PCMonAmtQ" at file location "CTS.mdb"

pls let me know what is the error

thanks in advance

venky|||Hmmmm, that's a strange error message. It seems like it is looking for a file called "PCMonAmtQ". Could that be associated with your db?

I wish I could be of more help, but I am at a lose here...

Keep me posted =)

Wednesday, March 7, 2012

Connecting to a different stored procedure at runtime

Hello..
I am using Crystal Reports 10. Am running the report through some asp pages. The report is tied to a stored procedure at design time. Can I make the report connect to a different stored procedure at runtime? Both these stored procs have the same output in terms of columns. They differ only in the data.
Thanks,
ManishTry this
In your Application Use

CR.Database.tables(0)="SP Name"

Saturday, February 25, 2012

Connecting SQL Server 2000 to legacy (AS/400) systems in a real time view?

Has anyone used SQL Server 2000 to attempt to get a real time view of a AS/400 system? Can you do it thru setting up a Linked Server?
Thanks,
Warren
Thanks Sue I will try this and let you know!
Thanks Again,
Warren

Connecting SQL Server 2000 to legacy (AS/400) systems in a real time view?

Has anyone used SQL Server 2000 to attempt to get a real time view of a AS/4
00 system? Can you do it thru setting up a Linked Server?
Thanks,
WarrenYes and yes.
Install Client Access on the SQL Server box and the
configure the linked server. For data source, use the IP
address of the AS400. For provider string, you need to
include the library you are using, connect timeout setting
and code page. There is some documentation for the settings
in the Client Access help files. You'd set the provider
string somewhat like:
InitCat=YourLibrary;CCSID=37;PCCodePage=
1252;
Data Source=xxx.xxx.xxx.xxx
Settings will depend on how your AS400 is configured. Again,
the Client Access help files have information on the
necessary connection string settings.
-Sue
On Tue, 6 Apr 2004 07:51:06 -0700, Warren
<anonymous@.discussions.microsoft.com> wrote:

>Has anyone used SQL Server 2000 to attempt to get a real time view of a AS/
400 system? Can you do it thru setting up a Linked Server?
>Thanks,
>Warren|||Thanks Sue I will try this and let you know!
Thanks Again,
Warren

Tuesday, February 14, 2012

connect using a non-interactive user

Hi,
I've been searching the web for some time, without any luck ...
Is it possible to connect to a SQL Server using a domain account that is
marked as a non-interactive user ?
Thanks,
Marc
"Marc Nemegeer" <nemegeermATdelaware.be.NOSPAM> wrote in message
news:eOPNDNg$EHA.4028@.TK2MSFTNGP15.phx.gbl...
> I've been searching the web for some time, without any luck ...
> Is it possible to connect to a SQL Server using a domain account that is
> marked as a non-interactive user ?
Where are you setting that option, on the server local security option, or
through group policy? Seems like it should be easy to test...
Steve

connect using a non-interactive user

Hi,
I've been searching the web for some time, without any luck ...
Is it possible to connect to a SQL Server using a domain account that is
marked as a non-interactive user '
Thanks,
Marc"Marc Nemegeer" <nemegeermATdelaware.be.NOSPAM> wrote in message
news:eOPNDNg$EHA.4028@.TK2MSFTNGP15.phx.gbl...
> I've been searching the web for some time, without any luck ...
> Is it possible to connect to a SQL Server using a domain account that is
> marked as a non-interactive user '
Where are you setting that option, on the server local security option, or
through group policy? Seems like it should be easy to test...
Steve