Run A Query On External Data(odbc) Criteria Based On Input Of A Ce — Excel |
||
I have an access database that I would like to put a DATE into a cell and
have it auto run a query with that date criteria. I have done this with the
query wizard and manualy but would like to automate the process by just
typing the date and pressing the enter any one who could lead me in the
right direction or who has done this before I would appreciate the help
—
thank you TR
Sql Server Odbc Error — Excel |
||
I have an Excel 2000 sheet based on a MS Query to a SQL Server 2000 database.
When I refresh the query, the ODBC connection fails with this error:
SQLState: ‘01000’
SQL Server Error: 11001
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets][ConnectionOpen
(Connect()).
Connection failed:
SQLState: ‘08001’
SQL Server Error: 6
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Specified SQL Server not
found.
An Access database with links to this SQL Server data source works just
fine. I tested the ODBC connection and it works fine.
The problem cropped up after the database and Excel sheets were moved to a
new physical server.
I tried to edit the Query in hopes of recreating it from scratch but I can’t
see the Query because the ODBC error appears and won’t open the query editor.
How can I fix the error or open the query so I can manually recreate it?
Thanks!
—Art
Ms Query Odbc Connection — Excel |
||
I have an excel sheet that I have MS Query attatched to. Recently, our servers were renamed to something different. I have changed my ODBC connections on my computer and updated my other excel sheets to point to the correct server via Script Editor, however, on one particular spreadsheet, the script editor is disabled and I can’t update the path.\trap-true, etc.
How can I tell this worksheet to point to the new server? There has to be something in the background where I can tell it to go.
BTW…..I’ve tried opening the Query and because the new server is down, it will not connect to allow me to cut and paste the SQL code to another worksheet.
Please help
Fetch Data From Oracle To Excel With Oracle Odbc Driver Using Vba — Excel |
||
Is there anybody know how to extract data from Oracle RDBMS to a Excel worksheet using VBA. Is it possible to create a db connection & a query in VBA code? Please advise. Thanks in advance.
clam
Filtering Odbc Data — Excel |
||
I have created an ODBC link into an SQL server using the Import External Data
function in Excel 2003. The data is coming through without any problems
except that there is too much of it. Excel has a limit of 65,000 lines and
there is around 300,000 lines of data trying to get through, and the data I
want is at the bottom.
I want to put a filter on one of the columns in the table but don’t know
how. I can see the Edit Query box but i’ve never really used SQL before.
Can anybody help?
Odbc Imports Numbers As Text — Excel |
||
When I use ODBC to import data into Excel, all numbers come through with a
leading apostrophe so that Excel sees them as text.
e..g INSERT INTO [Sheet1$] VALUES (10) will come into Excel as ’10
How Do I Export Data From Excel Into An Odbc Client / Or Plain Tex — Excel |
||
I have an excel workbook containing many sheets, of which I wish to export
the data residing on one worksheet only. I would like to know how to do 2
things.
1) export the data into an email so that it appears as flat text, not an
embedded picture, so that I am able to have a robot scrape the data to go
into an HTML ODBC. There will be approx 6 columns by 60 lines and the
workbook has many macros embedded in it.
2) export the data directly into an HTML ODBC
I am not a developer, but asking the questions for one, so appreciate layman
terms if possible, but happy to accept any and all help.
Thanks
Ora-12154 Tns Error For Odbc Connection Via Excel — Excel |
||
I have set up an ODBC connection via the Admin tools under control panel and it connects fine.
However, when I try to use the same connection to update from Excel, I receive the error ORA-12154: TNS: could not resolve the connect identifier specified.
I have validated that the tnsnames.ora file is in my current path.
I’m using the Oracle in instantclient10_2 driver to create the ODBC Data Source.
Any help would be SOOOO appreciated!
Thanks!!
Andrea
Embed Password In Vba For Odbc Connection — Excel |
||
My code executes a query from an oracle db. Everytime I try to run it, it asks for the ODBC password. I was wondering if it’s possible to embed the password in the code so it doesn’t ask for it. Below is my attempt from piecing together what I found through googling, but does not seem to work. any help would be appreciated, thanks.
Code:
Dim SQLStr As String Dim connection As ADODB.connection Dim rst As ADODB.Recordset Dim intRow As Integer SQLStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Range("DBPath") & ";Persist Security Info=False;" & _ "Jet OLEDB:Database Password='kchu_6789';" Set connection = New ADODB.connection connection.Open SQLStr Set rst = New ADODB.Recordset
Odbc Excel Driver Login Failed — Excel |
||
Hello guys,
I have a problem for which I can not find a solution within the net.
I have an excel file that uses MSQuery to extract data from other excel files and a VBA that updates all the queries automatically when the file is opened. It works just perfect but the problem is that if I try to open the file from different computers I get the «ODBC Excel Driver login failed»
I have installed all add-ins on each computer and they all have one and the same version of excel.
Could anybody advise what the problem could be?
Thanks a lot!
Updating Mysql Database With Excel Using Odbc? — Excel |
||
Hi,
I have managed to export my SQL db to excel using the mysql ODBC driver but is there any way for me to update mySQL database using the ODBC driver?
Refresh Pivot Same Time As Odbc Refresh — Excel |
||
Hi
I have a spreadsheet connected to our in house system via ODBC. When I refresh sheet2(data) I need sheet1(summary) — which is a pivot table using the data from sheet2(data) to update as well.
Any help on how I could achieve would be great.
Many thanks
Jon D
Preserving Data On Odbc Refresh — Excel |
||
Hi,
I download a table from SAGE accounts package using an ODBC link and MSQuery.
I have a series of additional columns in which I manipulate the linked data in various ways.
At some later time I need to refresh the link. Typicaly this will add some new data, relink some existing data and some of the existing data will no longer meet the criteria of the Query and will «drop off». I need to preserve the manipulation of the retained «old» data and have some flag to tell the program that the «new» data needs to be manipulated.
An initial download brings about 300 records. Each refresh adds about 30 and drops off about 30 records.
I thought that this would be easy, but the refresh seems to destroy the row and column relationships so I get spurious results.
can anyone help me with this please?
John Southern
Loop Thru And Delete All Odbc Connections — Excel |
||
Hello,
I have a workbook that I created to import any table on our SQL server via ODBC and once I am done with table I completely clear the worksheet to it’s original state (as if I just inserted a brand new sheet) and before I import another table, I would like to be able to loop through all the existing connections and delete them. I attempted this with the code below, however I don’t really know how to work with the ODBC object model.
Code:
Sub DeleteConnections() Dim Conn As ODBCConnection For Each Conn In ThisWorkbook.Connections 'Not sure what to put here. Next Conn End Sub
Please HELP!!!
Check Odbc Connection Before Refresh — Excel |
||
Hi
I have an Excel spreadsheet linked through to a sql table via and ODBC connection and I have a macro to refresh the data. I want the macro to first check that the ODBC connection exists before trying to refresh the data. So it would look like:
IF ODBC Connection exists THEN refresh data ELSE return warning message.
becoz when connection cannot be made, its gives me error. and i have to manually press ok button.
Any ideas….?
thanks
How To Fix ‘-2147467259 (80004005)’: [microsoft] [odbc Microsoft Access Driver] Not A Valid Password. — Excel |
||
Adding records to Database getting following error…
Getting error message exact as below
Code:
'-2147467259 (80004005)': [Microsoft] [ODBC Microsoft Access driver] not a valid password
Actual Code: error on BLUE line below.
I would really appriciate any help. Just stucked just dont know how to proceed…just same error already asked by someone too but doesnt solve me problem.
Code:
Sub CallAddTransfer() ' Used to call the code from page 480 Dim WS As Worksheet Dim Qty As Integer Set WS = Worksheets("AddRecords") FinalRow = WS.Cells(Rows.Count, 1).End(xlUp).Row Ctr = 0 For i = 7 To FinalRow Style = Cells(i, 1).Value FromStore = Cells(i, 2).Value ToStore = Cells(i, 3).Value Qty = Cells(i, 4).Value Ctr = Ctr + 1 Application.StatusBar = "Adding Record " & Ctr AddTransfer Style, FromStore, ToStore, Qty Next i Application.StatusBar = False MsgBox Ctr & " records added." End Sub Sub AddTransfer(Style As Variant, FromStore As Variant, ToStore As Variant, Qty As Integer) ' Page 480 Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Dim pwd As String MyConn = ThisWorkbook.Path & Application.PathSeparator & "Transfers.mdb" MyConn = "Driver=Microsoft Access Driver (*.mdb);DBQ=" & MyConn pwd = "mypass" ' open the connection Set cnn = New ADODB.Connection With cnn '.Provider = "Microsoft.Jet.OLEDB.4.0" .Open MyConn, mypass End With ' Define the Recordset Set rst = New ADODB.Recordset rst.CursorLocation = adUseServer ' open the table rst.Open Source:="tblTransfer", _ ActiveConnection:=cnn, _ CursorType:=adOpenDynamic, _ LockType:=adLockOptimistic, _ Options:=adCmdTable ' Add a record rst.AddNew ' Set up the values for the fields. The first four fields ' are passed from the calling userform. The date field ' is filled with the current date. rst("Style") = Style rst("FromStore") = FromStore rst("ToStore") = ToStore rst("Qty") = Qty rst("tDate") = Date rst("Sent") = False rst("Receive") = False ' Write the values to this record rst.Update ' Close rst.Close cnn.Close End Sub
The code is from Bill’s Latest book i guess .
Thanks again
Populate Combobox From Odbc Sql Query? — Excel |
||
Hello,
Wondering if is it possible to populate a combobox with values from a single column sql query.
1: I do not want to have the recordset returned to a query table and then have combobox populate from query table (trying to cut out the «middleman»)
2: I have odbc connections only, I do not have the privledges to add on the ADO add-ons, and if I can get it, my clients will not have it.
so,
The connectionstring I use is this
Code:
Dim varconnection As String varconnection = "ODBC;DRIVER={SQL Server};Server=MyServer;DATABASE=MyDatabase;UID=that dude;PWD=password"
Any help would be greatly appreciated
Vba To Connect To Database Using Odbc Data Source — Excel |
||
I like to connect to a SQL 2005 database from my Excel VBA project.
I have setup a ODBC data source called MSSQLDEV that connects to the SQL 2005 database
How do I build the connection string using this ODBC data source to connect to the SQL 2005?
thanks.
Vba: Using Querytables.add And Odbc To Query Mysql. Problem: Not All Columns Are Being Returned In Excel! — Excel |
||
Alright, I’ve setup a little macro in excel based on VBA code which runs a query against a MySQL database. This setup has been working great for us without any problems until now.
It seems the SQL query I’m trying to run is breaking QueryTables somehow. This query I’m trying to run is complex and involves a «UNION ALL». This SQL query runs perfectly fine in MySQL Query Browser.
However, when I try and run this query using QueryTables.Add and ODBC, some of the columns are not being returned.
Specifically, I have found that the only columns not being returned are ones which do not have matching UNION «Field Types».
aka: On the top part of my UNION, the first column returned is an INT, and on the bottom of my UNION (the second query), the first column is a VARCHAR. For some reason MySQL Query Browser is perfectly okay showing these results, but QueryTables can’t handle it, and drops these columns.
ANY help would be VERY APPRECIATED!!
Here is my VBA code:
Code:
Sub SQLGetNewData() Dim sConn As String Dim sSql As String Dim sDateFrom As String Dim sDateTo As String Dim oQt As QueryTable 'Sets the database connection sConn = "ODBC;DSN=Database_Name;UID=username;PWD=password" 'get query parameters Worksheets("Data").Activate 'build the query. ' I have not included the original complex SQL query here, and I have created a "VIEW" in MySQL to replicate the query. Because I have created a VIEW, I simply need to query this view just like it's a table. sSql = "SELECT * from view_revenue " Worksheets("Query Info").Activate [B7].Formula = sSql 'clear the data area Worksheets("Data").Activate Range("a1").CurrentRegion.ClearContents 'clear existing data connections For Each oQt In ActiveSheet.QueryTables oQt.Delete Next oQt If ActiveWorkbook.Connections.Count > 0 Then i = 1 Do While ActiveWorkbook.Connections.Count > 0 ActiveWorkbook.Connections.Item(i).Delete i = i - 1 Loop End If 'get new data With ActiveSheet.QueryTables.Add(Connection:=sConn, _ Destination:=Range("A1"), Sql:=sSql) .Refresh BackgroundQuery:=False .RefreshPeriod = 0 .RefreshOnFileOpen = False End With Worksheets("Data").Activate End Sub
Vba To Get Database Name From An Established Odbc Connection? — Excel |
||
Ok, here is the issue…
I’ve written an add-in that is used in a couple of locations. In each location, users have an ODBC connection to a database. The name of that ODBC connection is the same at each location.
However, the name of the actual database that it connects to varies…
For instance, in one location it is «Database»
But in another location it is «DATABASE»
The database holds the same information at both locations, but I’ve found my queries are case sensitive when it comes to establishing a connection.
Right now, I’m getting around it by using an inputbox, bt there has to be a better way…
Is there any way to use VBA to look at an existing ODBC connection and then get the name of the DB from there?
Any help or advice is appreciated.
Odbc Microsoft Access Driver Login Failed — Excel |
||
Hi,
A query has landed on my desk — which i’m struggling to figure out.
I have an Excel 2007 workbook which pulls data from a shared Access database.
The user has complained that it is not working properly.
To test it I attempted to refresh the connections, and get an error message:
ODBC Microsoft Access Driver Login Failed
Which then continues to say that it cannot find the mdb file. However, the path that it states the file should be in is different to where it is. This was working fine yesterday.
We also had a mandatory service update overnight — would this potentially cause this?
I’m trying to figure out if the file has been moved, whether it is a problem with the ODBC setup (and therefore infrastructure can have a look), or whether I have inadvertently changed something within the database itself (although I have only been creating queries).
Any help would be much appreciated!
pinkshirt
Odbc / Shared File On A Network Question — Excel |
||
I have a file on a netowk that has an ODBC sql feed set up.
When I choose to share the file, the «REFRESH DATA» icon is shaded out — thus meaning the user can not refresh on demand.
Im using excel 2003 is there a route round this?
Set Up Odbc Datasource Via Vba If User Doesn’t Have It Already — Excel |
||
Hello All,
I have a query table that is refreshed from a sql server. I have the connection string figured out
Code:
ODBC; DSN=myDSN; Description=myDescription; DATABASE=mydatabase; UID=me; PWD=mypassword
but, when I try to use it on someone’s computer who doesn’t have a datasource setup, it prompts them to do so with the ODBC Administrator program. Is there a way I can do this programatically?
user’s connection is to a SQL database.
Update: Okay, found out about DSN-less connections currently using
Code:
varConnection = "ODBC;DRIVER={SQL Server};Server=myserver;DATABASE=mydatabase;UID=me;PWD=mypassword"
However, the «Select Datasource» window still crops up. How do I set up the connect to avoid any prompts to «select Datasource» as that is a manual, technical process
Update: for servername, had to specify ip address as some end users were accessing remotely.
Multiple Sql Statements Off One Odbc Connection — Excel |
||
Hello,
I was wondering if it was possible to have more than one SQL statement off one ODBC Connection?
And if the answer is ‘Yes’ how?
Many Thanks
Andy
Run-time Error 3146 Odbc —call Failed — Excel |
||
I’m working with this Access 2000 database and am trying to export some information but continue to get the following error after I select the location to save…
Run-time error 3146 ODBC —call failed
When I attempt to debug the error it’s high-lighting the following code…
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, «TargSO», strFolderName & («Open_Sales») & Format(Date, «yymmdd») & «-» & Format(Time, «hhnn») & «.xls», True
MsgBox («File Created!»)
could anyone shed some light on whats going on or point me in the right direction?
any help would be muchly appreciated — thanks in advance.
Odbc Connection To Oracle — Prompting For Server Name — Excel |
||
Hi Folks:
I have a VBA script that communicates with Oracle — when I click on the refresh button, a dialog box pops up and asks for the Server Name …. I was wondering if I can pass this variable to the connection instead of having the users have to enter it each time — the problem is that they likely don’t even know what the server name is.
Thanks
Don
Query is below:
If global_username = «» Then Call password_entry
strConOracle = «Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) «
strConOracle = strConOracle & «(HOST=» & HOST & «)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=» & DBNAME
strConOracle = strConOracle & » ))); uid=» & ORACLE_USER_NAME & » ;pwd=» & ORACLE_PASSWORD & «;»
Set oConOracle = CreateObject(«ADODB.Connection»)
qstr = » Select * from query_result «
oConOracle.Open strConOracle
splitsql = SplitString(qstr)
‘ On Error Resume Next
With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
.Connection = «OLEDB;» & oConOracle
.CommandType = xlCmdSql
.CommandText = splitsql
.CreatePivotTable TableDestination:= _
«‘[ABCHAMP_resp_prof_JUL10 v17.xls]MainMenu’!R23C3″, TableName:=»PivotTable1», _
DefaultVersion:=xlPivotTableVersion10
End With
Macro To Change Odbc Connection Settings — Excel |
||
Running the macro recorder I got this:
Code:
With ActiveWorkbook.Connections("YearBS").ODBCConnection .BackgroundQuery = False .CommandText = Array( _ "sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'2009-01-01'}, DateTo = {d'2010-12-31'}, " _ , "SummarizeColumnsBy = 'Month'") .CommandType = xlCmdSql .Connection = Array(Array( _ "ODBC;DSN=QuickBooks Data;DFQ=I:ACCOUNTINGtest.QBW;SERVER=QODBC;OptimizerDBFolder=%UserProfile%QODBC " _ ), Array( _ "Driver for QuickBooksOptimizer;OptimizerAllowDirtyReads=N;SyncFromOtherTables=N" _ )) .RefreshOnFileOpen = False .SavePassword = False .SourceConnectionFile = "" .ServerCredentialsMethod = xlCredentialsMethodIntegrated .AlwaysUseConnectionFile = False End With
Now I want the 2 YEARS to be able to change based on cell data… Or if it helps the 2 cells are just This Year and last year (ie. NOW() and NOW()-365 but formatted as custom = YYYY)
So I have this, but it seems to throw me an error everytime I try it:
Code:
With ActiveWorkbook.Connections("YearBS").ODBCConnection .BackgroundQuery = False .CommandText = Array("sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'" + Range("D7").Text + "-01-01'}, DateTo = {d'" + Range("D8").Text + "-12-31'}, SummarizeColumnsBy = 'Month'") .CommandType = xlCmdSql .Connection = Array(Array( _ "ODBC;DSN=QuickBooks Data;DFQ=I:ACCOUNTINGtest.QBW;SERVER=QODBC;OptimizerDBFolder=%UserProfile%QODBC " _ ), Array( _ "Driver for QuickBooksOptimizer;OptimizerAllowDirtyReads=N;SyncFromOtherTables=N" _ )) .RefreshOnFileOpen = False .SavePassword = False .SourceConnectionFile = "" .ServerCredentialsMethod = xlCredentialsMethodIntegrated .AlwaysUseConnectionFile = False End With
The error I get now in Microsoft VB is
Run-time error ‘1004’:
Application-defined or object-defined error
I also tried changing
Code:
.CommandText = Array("sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'" + Range("D7").Text + "-01-01'}, DateTo = {d'" + Range("D8").Text + "-12-31'}, SummarizeColumnsBy = 'Month'")
to
Code:
.CommandText = Array( GetSQLString() )
after making
Code:
Public Function GetSQLString() GetSQLString = "sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'" + Range("D7").Text + "-01-01'}, DateTo = {d'" + Range("D8").Text + "-12-31'}, SummarizeColumnsBy = 'Month'" End Function
I also tried
Code:
.CommandText = Array(Sheet3.Range(D10))
after setting D10 on sheet3 to =GetSQLString()
Thanks for your help!
How To Test Odbc Connection — Excel |
||
I have created a system DSN to an SQL Database programmatically and would like to test the database connection via a command button before executing any queries against the database.
Can anyone help me write this?
Odbc Connection To Ms Project — Excel |
||
I need to create a database query within execl so I can update my excel sheet directly from a ms project source file.
Background story — currently have a massive programme plan. We also have an excel sheet which contains an extract of all the milestones from the programme plan. The excel sheet is updated on a weekly basis — updates made on RAG status, milestone end date and % complete. We are using a ‘milestone code’ to reference from excel to project. Because its a manual process of checking each individual milestone in the programme plan (140 milestones) its a long and tiresome process.
I was thinking that if we could automate this using an ODBC connection so it updates the data automatically it would cut down an hours work to the click of a button. So basically I was just wanting to know if that is possible. If not, are there any other suggestions to update the information automatically.
Thanks in advance.
P.S. I have attached a picture of a sample spreadsheet and project file as a reference. Hopefully it should give people an idea of what they look like and what Im trying to achieve.
Vba To Modify Existing Odbc Data Source — Excel — Excel |
||
Alright I have an existing data connection to an ODBC data source. I am curious how I can modify one of the query parameters programatically.
So for instance, my data connection properties which already has a connection setup includes this statement.statement:
SELECT «DataTable».»User Name»
FROM «DataTable» «DataTable»
WHERE («DataTable».»Office Location»= ‘Dallas TX’)
And I can refresh this query via VBA with Activeworkbook.RefreshAll or something similiar.
My question is, is there any way to programmatically change the queries parameter on the fly?
So I would like to define a variable called «Location» and then insert that into the Office Location part of the query…
I think if someone could help me get my data connection completely into VBA, instead of on the Data Connections tab, I could probably figure it out myself.
Thanks!
Odbc Connection To Sql Server With Excel — Excel |
||
Hi
We regularly develop queries from Excel via MS query to an SQL Server 2005 database.
We have had issues where if an Alias is used in the SQl Database and the Alias contains spaces MS query complains to the effect ‘Incorrect syntax near «whatever». On replacing the spaces with underscores all is well. Now to the point, we developed a spreadsheet using the above connections (even having the alias with spaces) and all was fine. It has now decided to erratically complain with ‘incorrect syntax etc.» message. Sometimes it will run correctly on my collegues machine but wont run correctly on mine. Strangley enough the client can dial in remotley and run the query fine.
We have SQL server 2005 and excel 2003 and 2007 and run windows xp professional.
Has anyone had this one before?
Regards
Alan
Odbc Query With Current Date — Excel |
||
I am trying to pull data into excel from another program using the ODBC query. This is the code that i have:
WHERE («BV:CallTracker».»Create-date»>={ts ‘2010-07-05 00:00:00’ })
where the date is located is what I am trying to change. I need it to just pull the current date without me having to manually enter it in.
Change Odbc Connection In Excel Vba — Excel |
||
Hi,
I have this connection which is working fine now. But i like it to be dynamic and picking up the new range from excel. I tried changing the cells in red to fPath but it wouldn’t work.
Hope someone can enlighten. Thanks.
Currently, cell E3 read as: C:DATADEMO17_DB.mdb
Sub SQLQuery()
Dim varConnection
Dim varSQL
Dim fPath As String
fPath = Range(«E3»).Value
Range(«A1»).CurrentRegion.ClearContents
varConnection = «ODBC; DSN=MS Access Database; DBQ= C:DATADEMO17_DB.mdb ; Driver{Driver do Microsoft Access(*.mdb)}»
varSQL = «SELECT DISTINCT AGENT from AGENTNAME»
With ActiveSheet.QueryTables.Add(Connection:=varConnection, Destination:=ActiveSheet.Range(«A1»))
.CommandText = varSQL
.Refresh BackgroundQuery:=False
End With
End Sub
Vba Macro To Refresh Odbc Connection Only Works Once — Excel |
||
Hello all,
I’m trying to use a macro to refresh a pivot table obtained thru an ODBC connection. At the same time, i want to change the CommandText field to change the dates i’m using (I only want to get one year of data). I did this by recording the refresh and then changing the CommandText. Here is the code I have at the moment:
Code:
FullString = "V_DATE_ACT>={ts '" + Dinicio + " 00:00:00'}) AND (V_LOGONE_DB.DLV_DATE_ACT
Broken Odbc Links Within Excel — Excel |
||
I have a client that has hundreds of spreadsheets that use database queries created within excel (not vb) to link to data stored in a third-party database (Pervasive) via ODBC.
Recently that datbase moved from Drive D: to Drive E:. I updated the ODBC connection to reflect the move. Unfortunately, now none of the excel queries work. I get an ODBC connection error.
If I create a brand new query using the same DSN, it works fine. The DSN also works fine in Access and Word.
I guess when the query is stored in Excel, it stores the the data location within the spreadsheet and no longer references the DSN. Is there any way to view or modify this connection short of creating new queries in hundreds of spreadsheets.
Thanks
Connect To Oracle Via Odbc Without Any Dialog For Password — Excel |
||
Hi,
I have the same problem!!!
http://www.excelforum.com/excel-programming/610563-macro-to-automatically-hit-database-using-password.html
Does anyone no this?
Excel Odbc — Excel |
||
Hi,
I am using Excel 2007 and Tally 9. I was able to export some master data from Tally into excel using ODBC but am unable to export transactions data
I someone could help me would really appreciate it
Increasing Activeworkbook.refreshall Performance For Odbc Connection…. — Excel |
||
I have a spreadsheet that has over 30 ODBC queries to a MS Access database. Via VBA I programmed a command button to do a simple refresh all:
ActiveWorkbook.RefreshAll
This takes about 30 minutes to complete…it seems to take a long time to Connect to the datasource (based upon the status bar message).
If I change the code to have 30 entries of the code below it takes less than 1 minute:
Worksheets(«Sheetx»).Activate
‘A1 is the location of the query table
Worksheets(«Sheetx»).Range(«A1»).Select
Selection.QueryTable.Refresh BackgroundQuery:=False
The workaround is worth it from a performance perspective but NOT from a maintenance perspective. Any advice on how to make the ActiveWorkbook.RefreshAll run in a reasonable amount of time.
General Odbc Error — Run Time Error 1004 — Excel |
||
Please help me before this laptop becomes a Frisbee!
I almost have this working but I’m getting stuck on this error every time I execute it. I have an ODBC with read-only privileges and I recorded part of the code from the macro. The «from» and «to» date fields I added ( I think I’m correct). I would truly appreciate the help.
Here’s the code:
Private Sub CommandButton1_Click()
Dim smpldatea As Date
Dim smpldateb As Date
Dim fdate1 As String
Dim fdate2 As String
smpldatea = UserForm1.TextBox1.Text
smpldateb = UserForm1.TextBox2.Text
fdate1 = Format(smpldatea, «m/d/yyyy hh:mm:ss»)
fdate2 = Format(smpldateb, «m/d/yyyy hh:mm:ss»)
Sheets(«Sheet1»).Activate
Range(«A1:H10000»).ClearContents
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
«ODBC;DRIVER={Oracle in OraHome92};SERVER=XXXXXX;UID=DT_I;PWD=RO2ACCESS;DBQ=XXXXXXP;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10» _
), Array( _
«;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;» _
)), Destination:=Range(«A1»))
.CommandText = Array( _
«SELECT DT_CENTERLINE_AUDIT.AUDIT_DATE, DT_CENTERLINE_AUDIT.CENTERLINE_ID, DT_CENTERLINE_AUDIT.COMPLIANT, DT_CENTERLINE_AUDIT.CORRECTED, DT_CENTERLINE_AUDIT.LINE, DT_CENTERLINE_AUDIT.LOCATION» & Chr(13) & «» & Chr(10) & «FROM DTD» _
, _
«BA.DT_CENTERLINE_AUDIT DT_CENTERLINE_AUDIT» & Chr(13) & «» & Chr(10) & «WHERE (DT_CENTERLINE_AUDIT.AUDIT_DATE>= ‘» & fdate1 & «‘ And DT_CENTERLINE_AUDIT.AUDIT_DATE
Automating Ado/odbc Connection — Excel |
||
I have a client with an excel spreadsheet that is based on several ODBC queries. He is writing a macro to automate the data refresh. He has the username/password for the server coded in the connection string as described on Microsoft’s support site: «DSN=; UID=; PWD=
;» and the password is saved in the ODBC connection as well. However, when he runs the Macro to refresh, it still prompts him for the password as it refreshes each query. The username populates correctly but the password field stays blank. Any ideas?
Odbc Connection Error — Excel |
||
Hello,
I am modifying the macro in Excel, which was written by my colleague before he quits the company. I have been assigned to continue coding the macro in Excel. The objective of this macro would be » get the required data from a local DB by calling the SQL query and plot the graph based on the data gathered » .
I am quite new to this environment and I am slowly learning the VBA scripts coded by my colleague. When I run the macro, I am getting the Run time error
«Run Time Error 3146 ODBC — call failed». I searched in the internet to resolve this problem, but I couldn’t. May be if I am aware of those kind of Excel macros, I could have solved this run time error.
I have pasted below the code
Public FileContents As String ‘global variable to contain the SQL query string
Public RowCounter As Integer
Public ColCounter As Integer
Public RowCounter1 As Integer
Public ColCounter1 As Integer
Const FTP_ip = «10.68.20.158»
Private Sub CommandButton1_Click()
Dim strDBName As String
Dim strDBUser As String
Dim strDBPwd As String
Dim strDSNName As String
Dim strConnectionStr As String
Dim strQueryFile_path As String ‘filepath of SQL Query file
Dim wrkODBC As Workspace
Dim conDb As Connection
Dim rstTemp As Recordset
strDBName = «tpfdb»
strDBUser = «root»
strDBPwd = «admin»
strDSNName = «tpfdatabase»
strQueryFile_path = ThisWorkbook.Path & «Queries»
‘ Create ODBCDirect Workspace object.
Set wrkODBC = CreateWorkspace(«NewODBCWorkspace», strDBUser, strDBPwd, dbUseODBC)
‘ Open read-only Connection object based on information
‘ you enter in the ODBC Driver Manager dialog box.
strConnectionStr = «ODBC;DATABASE=» + strDBName + «;UID=» + strDBUser + «;PWD=» + strDBPwd + «;DSN=» + strDSNName
Set conDb = wrkODBC.OpenConnection(«localdb», dbDriverComplete, False, strConnectionStr)
Set rstTemp = conDb.OpenRecordset(«SET GLOBAL sql_mode=’ANSI’;», dbOpenDynamic)
I am getting the error while executing the command highlighted above. As I said i am new to this environment, can anyone help me to resolve this?
Also it would be great if anyone can give me some reference/websites that tells about ODBC in Excel.
Many Thanks in Advance!!!!!!!!!!
———————————————————-
Regards,
Hari.
Excel Odbc Connection To Sql Server Table Failed — Excel |
||
Programmers,
Here is the situation: The company I work for has several Excel spreadsheets that are linked to our SQL Server 2000 database via an Access file. All has worked for years until now. When I try to Refresh the spreadsheet for Company3, I get an ODBC Connection Failed Error. Basically, the configuration is as follows:
SQL Server: Database has 3 tables for each company which we will call respectively — Company1, Company2, Company3.
AccessFile.mdb contains linked tables to those tables.
Excel Spreadsheets have a Microsoft Query defined using a Microsoft Access ODBC driver. From there, the linked table
Company3 and its appropriate columns are selected. (it is interesting to note the connection seems to work as it will show the column names when I click (+) to expand the table.) However, as soon I try to run the query, it fails with a ODBC Connection Error.
+++ Note +++ If I select a SQL Server ODBC driver instead of a Microsoft Access ODBC driver in the Microsoft Query Wizard, it will work fine. Data gets refreshed with no problem.
Here is what I have tried and observed:
1. Tested the OBDC connection through the ODBC Datasource Adminstrator. Works fine.
2. In Microsoft Query, selected SQL Server 2000 ODBC Driver.
Refreshed the Excel Spreadsheet. Works as mentioned above.
(The current configuration worked previously using an Access ODBC Driver to the linked SQL table.)
3. Created a new Access database with a link to Company3, thinking maybe the mdb file is corrupt. Still didn’t work.
4. I created a new Excel spreadsheet and Microsoft Query to
to the linked table. Same results.
5. Compared the datatypes for Company3 against Company1 and Company2. Looked ok.
6. Copied Company3 into a test table. Tried Refreshing the Excel spreadsheet with Access ODBC Driver and the test table (all records). ODBC Connection failed. I even tried deleting all but one record in the table, but I obtained the same results.
7. Tried SQL Profiler to see if could give any useful information why the conncection failed. All I could find that it was testing the connection, but I could find any information why it failed.
9. Turned on ODBC tracing. Here is a snapshot of the log file:
msqry32 580-eb0 ENTER SQLDriverConnectW
HDBC 00892BD0
HWND 00000000
WCHAR * 0x74329A38 [ -3] «****** 0»
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 3 <SQL_DRIVER_COMPLETE_REQUIRED>
msqry32 580-eb0 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 00892BD0
HWND 00000000
WCHAR * 0x74329A38 [ -3] «****** 0»
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 3 <SQL_DRIVER_COMPLETE_REQUIRED>
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver’s SQLSetConnectAttr failed (0)
DIAG [IM008] [Microsoft][ODBC SQL Server Driver]Dialog failed (0)
msqry32 580-eb0 ENTER SQLErrorW
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4
WCHAR * 0x02417260
SWORD 4095
SWORD * 0x0012D4C0
msqry32 580-eb0 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4 (0)
WCHAR * 0x02417260 [ 66] «[Microsoft][ODBC Driver Manager] Driver’s SQLSetConnectAttr failed»
SWORD 4095
SWORD * 0x0012D4C0 (66)
msqry32 580-eb0 ENTER SQLErrorW
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4
WCHAR * 0x024172F6
SWORD 4020
SWORD * 0x0012D4C0
msqry32 580-eb0 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4 (0)
WCHAR * 0x024172F6 [ 48] «[Microsoft][ODBC SQL Server Driver]Dialog failed»
SWORD 4020
SWORD * 0x0012D4C0 (48)
msqry32 580-eb0 ENTER SQLErrorW
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4
WCHAR * 0x02417368
SWORD 3963
SWORD * 0x0012D4C0
msqry32 580-eb0 EXIT SQLErrorW with return code 100 (SQL_NO_DATA_FOUND)
HENV 00892B58
HDBC 00892BD0
HSTMT 00000000
WCHAR * 0x0012D488 (NYI)
SDWORD * 0x0012D4D4
WCHAR * 0x02417368
SWORD 3963
SWORD * 0x0012D4C0
msqry32 580-eb0 ENTER SQLFreeConnect
HDBC 00892BD0
msqry32 580-eb0 EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
HDBC 00892BD0
msqry32 580-eb0 EXIT SQLExecute with return code -1 (SQL_ERROR)
HSTMT 00891B18
DIAG [S1000] [Microsoft][ODBC Microsoft Access Driver] ODBC—connection to ‘CompanyDatabase’ failed. (-2001)
Not sure what is causing this error. I am leaning that it has to so some thing with the table (Company3) itself. Permissions? Any assistance on issue would be greatly appreciated.:-)
By the way, does anyone know why sometimes you get a login dialog when you open a datasource and sometimes not?
Odbc Connect Via Macro — Excel |
||
I wish to import a Oracle table via a macro and have done it via the wizzard and recorded that. when i run it i get a 1004 error at the refresh. I then scripted it myself and it fails at the connect line. Can you help me please. I got the driver from a record macro script…
My script:
Dim oConn As Object, oRS As Object
Password = InputBox(«input password», «enter password»)
Set oConn = CreateObject(«ADODB.Connection»)
oConn.Open «Driver={Oracle ODBC Driver};» & _
«Dbq=RPTCCB;» & _
«Uid=JSHAPER;» & _
«Pwd=» & Password
Set oRS = CreateObject(«ADODB.RecordSet»)
oRS.Open «SELECT SC_ACCESS_CNTL.USR_GRP_ID, SC_ACCESS_CNTL.APP_SVC_ID, SC_ACCESS_CNTL.ACCESS_MODE, SC_USR_GRP_PROF.EXPIRATION_DT, SC_ACCESS_CNTL.VERSION, SC_ACCESS_CNTL.OWNER_FLG FROM CRYSTAL.SC_ACCESS_CNTL SC_ACCESS_CNTL, PRDCCB01.SC_USR_GRP_PROF SC_USR_GRP_PROF WHERE SC_ACCESS_CNTL.APP_SVC_ID = SC_USR_GRP_PROF.APP_SVC_ID AND SC_ACCESS_CNTL.USR_GRP_ID = SC_USR_GRP_PROF.USR_GRP_ID», oConn
Range(«A1»).CopyFromRecordset oRS
Thank you in advance to anyone that spends any time helping me figure this out…
Sql Query (odbc) With Cell Reference — Excel |
||
I have a SQL query (through an ODBC connection) that populates an Excel spreadsheet. The thing is that I want add a criteria «WHERE x = [cell reference]». I know this question has been asked repeatedly in different forms but it seems that connecting with Excel 2007 through an ODBC connection doesn’t behave the way others do. I’ve tried using the following syntax:
WHERE A.EMPLID = ‘» & Range(«B1») & «‘
A.EMPLID is my SQL field name
B1 is the cell where I enter my A.EMPLID filter value
If I manually edit the query (as below) it returns a perfect set of data. I’m just trying to avoid having to manually edit the query every time I want a new data set.
WHERE A.EMPLID = ‘81726354’
The query with the cell reference doesn’t cause any errors but it doesn’t return any results either. I’ve also named the cell as a range but don’t know how I’d reference that in a SQL query (if that’s even possible). I’m trying to avoid doing it with VBA.
What Does This Mean? : Microsoft Odbc Access Driver Too Few Parameters Expected 1 — Excel |
||
I have had this message pop up on a workbook that has been running flawlessly for monthe. The table goes to an Access book and queries a table and imports the reuslts. And suddenly today I am getting this message. Does anyone know what it means?
[Microsoft] [ODBC Access Driver] Too few parameters: Expected 1
Vba Code For Getting Data From Oracle — No Odbc — Excel |
||
Hi All,
I need your help. Could you please provide me a sample code which will allow me to connect to Oracle 10g Database and get some rows out of it. I want to do it without using ODBC
Thanks
Yeheya
Macro To Change Odbc Connection String — Excel |
||
I am trying to change the SQL command to an odbc database connection
Code:
Sub Macro1() ' ' Macro1 Macro ' ' With ActiveWorkbook.Connections("YearBS").ODBCConnection .BackgroundQuery = False .CommandText = Array( _ "sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'2009-01-01'}, DateTo = {d'2010-12-31'}, " _ , "SummarizeColumnsBy = 'Month'") .CommandType = xlCmdSql .Connection = Array(Array( _ "ODBC;DSN=QuickBooks Data;DFQ=I:ACCOUNTINGQuickbooksRed Tail Networks, Inc.QBW;SERVER=QODBC;OptimizerDBFolder=%UserProfile%QODBC " _ ), Array( _ "Driver for QuickBooksOptimizer;OptimizerAllowDirtyReads=N;SyncFromOtherTables=N" _ )) .RefreshOnFileOpen = False .SavePassword = False .SourceConnectionFile = "" .ServerCredentialsMethod = xlCredentialsMethodIntegrated .AlwaysUseConnectionFile = False End With With ActiveWorkbook.Connections("YearBS") .Name = "YearBS" .Description = "" End With ActiveWorkbook.Connections("YearBS").Refresh End Sub
I recorded that in excel and then when I try to run it I get an error of:
When I debug it highlights this line:
Code:
.CommandText = Array( _ "sp_report BalanceSheetStandard show Label, Amount parameters DateFrom = {d'2009-01-01'}, DateTo = {d'2010-12-31'}, " _ , "SummarizeColumnsBy = 'Month'")
Any help would be appreciated thank you.
Now I also found this:
http://p2p.wrox.com/excel-vba/29037-…has-1-rpt.html
which makes it out to be a bug in excel and that I need to change the type of connection, then change the string, then change the type of connection back. I am not really sure how to do this but below is the post that seems important from the link above:
Quote:
I wrote the following functions which I call right before and after I update the CommandText.
Private Sub dbODBCtoOLEDB()
Dim pcPivotCache As PivotCache
Dim strConnection As String
For Each pcPivotCache In ActiveWorkbook.PivotCaches
If pcPivotCache.QueryType = xlODBCQuery Then
strConnection = _
Replace(pcPivotCache.Connection, «ODBC;DSN», «OLEDB;DSN», 1, 1, vbTextCompare)
pcPivotCache.Connection = strConnection
End If
Next pcPivotCache
End Sub
Private Sub dbOLEDBtoODBC()
Dim pcPivotCache As PivotCache
Dim strConnection As String
For Each pcPivotCache In ActiveWorkbook.PivotCaches
If pcPivotCache.QueryType = xlOLEDBQuery Then
strConnection = _
Replace(pcPivotCache.Connection, «OLEDB;DSN», «ODBC;DSN», 1, 1, vbTextCompare)
pcPivotCache.Connection = strConnection
End If
pcPivotCache.Refresh
Next pcPivotCache
End Sub
If anyone could help me adapt this to my connection that would be incredible. It is important to note I will be running this 3 times to change seperate pivot tables and that I also have other pivot tables that connect to a different database that I do not need changed. Thanks!
Using Function In In Access Odbc Query — Excel |
||
Hey Guys,
I have an access database as a store for some data. I have a custom function in my MDB that is basically a CASE statement. It works when build queries within the MDB itself…is there a way I can call on this function when querying the tables externally via an access ODBC connection?
I am using microsoft query to pull the data into excel.
Thanks
Odbc —call Failed — Struggling With This For Weeks — Excel |
||
Hi,
I just started working with access and I am getting this error every two queries that I run. What I need to do is close Access and start it again and then I get to run two more queries and it crashes again.
I dont know why this is happening but obviously something it wrong. I Googled it and could not find an answer.
The error message I get is:
ODBC—call failed.
[MySQL][ODBC 5.1 Driver]….-highperf-b13-log]MySQL server has gone away (#2006)
Does anyone know why this is happening and what I can do to fix it?
Please let me know.
Thanks,
— Lior
Column Limit Using Excel To Excel Odbc — Excel |
||
Currently I have an excel 2007 spreadheeet with around 400 columns of data, I was then hoping to make an ODBC connection to this from a worksheet on a second spreadsheet. Unfortunately only 250 odd columns are actually being recognised using this ODBC link, is there a way around this?
Errors like SQL server connection failed SQLState 08001 can be really annoying.
The SQL server connection failed 08001 occurs when creating an ODBC connection on the Microsoft SQL.
At Bobcares, we often get requests from our customers regarding the SQL sever connection error as part of our Server Management Services.
Today, we’ll see the reasons for this SQL sever connection instance and how our Support Engineers fix it.
When the SQL Server Connection failed: SQLState 08001 Occurs?
Mostly the error SQLStateServer Connection failed 08001 occurs when creating an ODBC connection on Microsoft SQL.
We click Next on the SQL login screen. Then using the login information provided, the ODBC manager will try to connect to the SQL Server. But after some waiting time, it displays the below error message.
The main three reasons for the error SQL Server Connection failure are
- If we provide a wrong server name.
- If the SQL Server not configured to a network connection.
- The other possibility of this instance if we provide an incorrect login name or password.
How to fix SQLState 08001 Error?
Recently, one of our customers approached us with an error message ‘SQL Server Connection failed: SQLState 08001′.
Our Support Engineers log in to SQL Server Management Studio and make sure that the database name and other details are correct. In case, if the database server name is wrong then this error can occur.
Sometimes the message appears when we use ‘localhost’ as the Database Server name on the Database Settings screen in Confirm. But we can log in to the database in SQL Server Management Studio as a user, using the Server name ‘localhost’. Then our Support Engineers make any of the below two changes to fix the error.
- In the Database Settings screen, we change the Database Server name to the server name or
- In the SQL Server Configuration Manager, we enable the Named Pipes values in the Client Protocols.
Our Support Engineers follow any of the above two methods to fixes the error while creating an ODBC connection on Microsoft SQL.
[Need assistance in fixing the Error while creating an ODBC connection? – We can help you.]
Conclusion
In short, we’ve discussed that the SQL server connection failed SQLState 08001 occurs when creating an ODBC connection on the Microsoft SQL. Also, we saw how our Support Engineers fix the error for the customers.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
Содержание
- Ошибка подключения к базе 7.7 SQL
- SQL Server Connection failed : SQLState 08001 – Let’s fix it!!
- When the SQL Server Connection failed: SQLState 08001 Occurs?
- How to fix SQLState 08001 Error?
- Conclusion
- PREVENT YOUR SERVER FROM CRASHING!
- 4 Comments
- TablePlus
- Connection failed — SQLState ‘08001’ in SQL Server
- Точка подключения службы не подключается в System Center Configuration Manager
- Проблемы
- Решение
- Сведения об исправлении
- Предварительные условия
- Необходимость перезагрузки
- Сведения о замене исправлений
- Sql server native error 08001
- Answered by:
- Question
- Answers
- All replies
Ошибка подключения к базе 7.7 SQL
База 1С SQL. Подключается 5 ПК. На одном из них переустановили систему, установили платформу 7.7, при попытке подключения к базе выдает ошибку:
SQL State:08001
Native:17
Messeg:[Microsoft][ODBC SQL Server Driver][DBNetLib] SQL Server не существует или отсутствует доступ.
SQL State:01000
Native:2
Messeg:[Microsoft][ODBC SQL Server Driver][DBNetLib] Connection open(Connect())
Помогите разобраться, как исправить?
Причин возникновения проблем с подключением к SQL Server-у может быть много, но есть простые методы диагностики и выявления проблем подключения к серверу.
Шаг 1.
Попробуйте «пропинговать» сервер БД как по имени так и по IP-адресу, командой
Ping [SQLServerDNSName], где SQLServerDNSName – DNS имя сервера БД в сети. Если возникли проблемы с пингом по имени, то необходимо устранить проблемы со службой DNS в Вашей сети. Если сервер не пингуется по IP-адресу, то необходимо решить проблемы, либо с маршрутизацией пакетов в сети, или проверить саму сеть на наличие физических обрывов.
Шаг 2.
Выполняется при условии, что шаг 1 выполнился успешно.
Простая проверка к соединения с сервером БД осуществляется командой
telnet [SQLServerIPAdress] [port] – где SQLServerIPAdress IP-адрес сервера, port-порт подключения к серверу, по умолчанию 1433. При удачном подключении, экран терминала telnet будет чистым с мигающим курсором. При неудачном подключении необходимо проверить порт подключения к серверу. Определение настроек порта на клиенте выполняется утилитой cliconfg.exe, на сервере — утилитой svrnetcn.exe.
Шаг 3.
Выполняется при условии, что шаги 1 и 2 выполнились успешно.
Часто на этом шаге при подключении возникает ошибка «Login failed for user [UserName]», где UserName-имя пользователя, под которым вы хотите подключиться к серверу БД. При возникновении такой ошибки необходимо проверить тип авторизации. По умолчанию при установке SQL Server-а разрешена только Windows авторизация. Если Вы подключаетесь под логином sa, то Вам необходимо установить на сервере БД смешанную(mixed) авторизацию. Также необходимо проверить пароль для логина, под которым Вы подключаетесь.
Источник
SQL Server Connection failed : SQLState 08001 – Let’s fix it!!
by Sharon Thomas | Jan 14, 2020
Errors like SQL server connection failed SQLState 08001 can be really annoying.
The SQL server connection failed 08001 occurs when creating an ODBC connection on the Microsoft SQL.
At Bobcares, we often get requests from our customers regarding the SQL sever connection error as part of our Server Management Services.
Today, we’ll see the reasons for this SQL sever connection instance and how our Support Engineers fix it.
When the SQL Server Connection failed: SQLState 08001 Occurs?
Mostly the error SQLStateServer Connection failed 08001 occurs when creating an ODBC connection on Microsoft SQL.
We click Next on the SQL login screen. Then using the login information provided, the ODBC manager will try to connect to the SQL Server. But after some waiting time, it displays the below error message.
The main three reasons for the error SQL Server Connection failure are
- If we provide a wrong server name.
- If the SQL Server not configured to a network connection.
- The other possibility of this instance if we provide an incorrect login name or password.
How to fix SQLState 08001 Error?
Recently, one of our customers approached us with an error message ‘SQL Server Connection failed: SQLState 08001′.
Our Support Engineers log in to SQL Server Management Studio and make sure that the database name and other details are correct. In case, if the database server name is wrong then this error can occur.
Sometimes the message appears when we use ‘localhost’ as the Database Server name on the Database Settings screen in Confirm. But we can log in to the database in SQL Server Management Studio as a user, using the Server name ‘localhost’. Then our Support Engineers make any of the below two changes to fix the error.
- In the Database Settings screen, we change the Database Server name to the server name or
- In the SQL Server Configuration Manager, we enable the Named Pipes values in the Client Protocols.
Our Support Engineers follow any of the above two methods to fixes the error while creating an ODBC connection on Microsoft SQL.
[Need assistance in fixing the Error while creating an ODBC connection? – We can help you.]
Conclusion
In short, we’ve discussed that the SQL server connection failed SQLState 08001 occurs when creating an ODBC connection on the Microsoft SQL. Also, we saw how our Support Engineers fix the error for the customers.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
I got same situation or error message and the issue in my particular case was that the number of connections was set to a maximum of 500. similar issue happened when this limit is reached therefore you can either reboot the SQL instance to get rid of idle connections. But if this happens frequently change the number of connections to unlimited (Value 0).
Alemayehu G. Desta
Hello Alemayehu,
Indeed the connection limit does cause SQL errors.
Named Pipes Solution solved.
Hi Manoj,
Glad to know that the problem got fixed.
Источник
TablePlus
Connection failed — SQLState ‘08001’ in SQL Server
September 25, 2019
When creating a connection to SQL Server using an ODBC driver, you might receive this error:
Here are some common causes and corresponding fixes:
1. SQL Server service is not running on SQL Server.
You can try to start or restart SQL Server services, including SQL Server Database Engine, the SQL Server Agent, or the SQL Server Browser service.
2. SQL Server Browser service is not running on SQL Server.
This might cause the issue sometime so make sure to enable the “SQL Server Browser” Service and set to start Automatically.
3. TCP/IP protocol is not enabled for SQL Server.
Make sure the TCP/IP protocol is enabled by logging in to the SQL server, navigate to the “Sql Server Configuration Manager”, then enable the “TCP/IP” and the “Named Pipes” Protocols.
4. Firewall on SQL Server is blocking TCP port of SQL Server.
Check and reconfig the firewall rules to allow SQL Server access.
5. Firewall on SQL Server is blocking UDP port (1434) of SQL Server browser.
Again, check and reconfig the firewall rules to allow SQL Server access.
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL, and many other databases simultaneously using an intuitive and powerful graphical interface.
Источник
Точка подключения службы не подключается в System Center Configuration Manager
Проблемы
Вы обнаружили, что System Center Configuration Manager сайта не может подключиться к SQL Server. Эта проблема возникает при выполнении следующих условий:
База данных сервера сайта настроена для обмена данными с помощью именованного экземпляра SQL сервера и пользовательского порта.
Роль «точка подключения службы» устанавливается на том же компьютере, где выполняется SQL Server.
В этом случае записи, похожие на следующие, записываются в файлы smsexec.log и hman.log на сервере сайта:
[08001][2][Microsoft][SQL Server Native Client 11.0]Поставщик именованных каналов: не удалось открыть подключение к SQL Server [2].
[HYT00][0][Microsoft][SQL Server Native Client 11.0]
Истекло время ожидания входа*** [08001][2][Microsoft][SQL Server Native Client 11.0]При установке подключения к SQL Server произошла ошибка, связанная с сетью или экземпляром. Сервер не найден или недоступен. Проверьте правильность имени экземпляра и SQL Server настроены для разрешения удаленных подключений. Дополнительные сведения см. в SQL Server электронной документации.
Не удалось подключиться к SQL Server, тип подключения: SMS ACCESS.
Решение
Сведения об исправлении
Поддерживаемое исправление доступно в служба поддержки Майкрософт. Однако это исправление предназначено только для устранения проблемы, описанной в этой статье. Примените это исправление только к системам, в которых возникла проблема, описанная в этой статье. Это исправление может получить дополнительное тестирование. Поэтому, если эта проблема серьезно не затрагивает вас, рекомендуется дождаться следующего обновления программного обеспечения, содержащего это исправление.
Если исправление доступно для скачивания, в верхней части этой статьи базы знаний есть раздел «Доступно скачивание исправлений». Если этот раздел не отображается, обратитесь в службу поддержки клиентов Майкрософт, чтобы получить исправление.
Обратите внимание, что при возникновении дополнительных проблем или необходимости устранения неполадок может потребоваться создать отдельный запрос на обслуживание. Обычные затраты на поддержку будут применяться к дополнительным вопросам поддержки и вопросам, которые не подходят для этого исправления. Полный список номеров телефонов службы поддержки и обслуживания майкрософт или создания отдельного запроса на обслуживание см. на следующем веб-сайте Майкрософт:
http://support.microsoft.com/contactus/?ws=supportОбратите внимание, что в форме «Доступно скачивание исправлений» отображаются языки, для которых доступно исправление. Если язык не отображается, исправление недоступно для этого языка.
Предварительные условия
Чтобы применить это исправление, необходимо установить версию выпуска System Center Configuration Manager версии 1511.
Необходимость перезагрузки
После применения этого исправления не нужно перезапускать компьютер.
Сведения о замене исправлений
Это исправление не заменяет ранее выпущенное исправление.
Источник
Sql server native error 08001
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Client setup system as below
OS: Windows 2008 R2 64 bit and installed SQL native client 11.0 (SQL 2012) for DSN creation.
Successfully created DSN when using with default SQL server ODBC driver in client machine. (by using AG listener name)
when try to connect via SQL native client 11.0 ODBC driver does not allowed and throwing SQL state 08001 error and time out messages.
Pl. help, how overcome this time out errors? does it require to install any patches?
Answers
Yes.. In client machine win 2008 R2 — SQL 2012 SSMS installed, I can able connect only AG Listener Name.
Does not connect if adding parameter -M (multisubnetfailover)..
Maybe this will help (Connection times out when you use AlwaysOn availability group listener with MultiSubnetFailover parameter): https://support.microsoft.com/en-us/kb/2870437
As a side note, I’d see if you can talk the client into upgrading from Windows 2008 R2. I would not recommend using it for any new projects.
I hope you found this helpful! If you did, please vote it as helpful on the left. If it answered your question, please mark it as the answer below. 🙂
- Edited by Daniel Janik Tuesday, August 2, 2016 5:20 AM
- Proposed as answer by Lin Leng Microsoft contingent staff Sunday, August 14, 2016 2:53 PM
- Marked as answer by Lin Leng Microsoft contingent staff Monday, August 15, 2016 2:00 AM
I recall there being several hotfixes and to-dos to make Availability groups work with Windows 2008 R2.
It’s been quite a while since I’ve thought about that configuration; so, I can’t tell you if it’s recommended or not. Last time I looked into it was 2014 and the answer was don’t run a SQL AG on Win 2008 R2. You’re much better off using Windows 2012 or later.
Again, I don’t know if that’s changed but I would also question configuring Windows 2008 R2 as a new server mid way through 2016. Didn’t mainstream support end in January 2015?
I hope you found this helpful! If you did, please vote it as helpful on the left. If it answered your question, please mark it as the answer below. 🙂
Источник
TablePlus
Connection failed — SQLState ‘08001’ in SQL Server
September 25, 2019
When creating a connection to SQL Server using an ODBC driver, you might receive this error:
Here are some common causes and corresponding fixes:
1. SQL Server service is not running on SQL Server.
You can try to start or restart SQL Server services, including SQL Server Database Engine, the SQL Server Agent, or the SQL Server Browser service.
2. SQL Server Browser service is not running on SQL Server.
This might cause the issue sometime so make sure to enable the “SQL Server Browser” Service and set to start Automatically.
3. TCP/IP protocol is not enabled for SQL Server.
Make sure the TCP/IP protocol is enabled by logging in to the SQL server, navigate to the “Sql Server Configuration Manager”, then enable the “TCP/IP” and the “Named Pipes” Protocols.
4. Firewall on SQL Server is blocking TCP port of SQL Server.
Check and reconfig the firewall rules to allow SQL Server access.
5. Firewall on SQL Server is blocking UDP port (1434) of SQL Server browser.
Again, check and reconfig the firewall rules to allow SQL Server access.
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL, and many other databases simultaneously using an intuitive and powerful graphical interface.
Источник
SQL Server Connection failed : SQLState 08001 – Let’s fix it!!
by Sharon Thomas | Jan 14, 2020
Errors like SQL server connection failed SQLState 08001 can be really annoying.
The SQL server connection failed 08001 occurs when creating an ODBC connection on the Microsoft SQL.
At Bobcares, we often get requests from our customers regarding the SQL sever connection error as part of our Server Management Services.
Today, we’ll see the reasons for this SQL sever connection instance and how our Support Engineers fix it.
When the SQL Server Connection failed: SQLState 08001 Occurs?
Mostly the error SQLStateServer Connection failed 08001 occurs when creating an ODBC connection on Microsoft SQL.
We click Next on the SQL login screen. Then using the login information provided, the ODBC manager will try to connect to the SQL Server. But after some waiting time, it displays the below error message.
The main three reasons for the error SQL Server Connection failure are
- If we provide a wrong server name.
- If the SQL Server not configured to a network connection.
- The other possibility of this instance if we provide an incorrect login name or password.
How to fix SQLState 08001 Error?
Recently, one of our customers approached us with an error message ‘SQL Server Connection failed: SQLState 08001′.
Our Support Engineers log in to SQL Server Management Studio and make sure that the database name and other details are correct. In case, if the database server name is wrong then this error can occur.
Sometimes the message appears when we use ‘localhost’ as the Database Server name on the Database Settings screen in Confirm. But we can log in to the database in SQL Server Management Studio as a user, using the Server name ‘localhost’. Then our Support Engineers make any of the below two changes to fix the error.
- In the Database Settings screen, we change the Database Server name to the server name or
- In the SQL Server Configuration Manager, we enable the Named Pipes values in the Client Protocols.
Our Support Engineers follow any of the above two methods to fixes the error while creating an ODBC connection on Microsoft SQL.
[Need assistance in fixing the Error while creating an ODBC connection? – We can help you.]
Conclusion
In short, we’ve discussed that the SQL server connection failed SQLState 08001 occurs when creating an ODBC connection on the Microsoft SQL. Also, we saw how our Support Engineers fix the error for the customers.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
4 Comments
I got same situation or error message and the issue in my particular case was that the number of connections was set to a maximum of 500. similar issue happened when this limit is reached therefore you can either reboot the SQL instance to get rid of idle connections. But if this happens frequently change the number of connections to unlimited (Value 0).
Alemayehu G. Desta
Hello Alemayehu,
Indeed the connection limit does cause SQL errors.
Named Pipes Solution solved.
Hi Manoj,
Glad to know that the problem got fixed.
Источник
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Hi Everyone,
I am having conundrum guys. I recently moved all my access linked database to new NAS device except one client all works fine with database where it comes out with error «
Connection failed:
SQLState: ‘01000’
SQL Server Error: 1703
[Microsoft][ODBC SQL Server Driver][Multi-Protocol]
ConnectionOpen(RPCopen())
Connection failed:
SQLState:’08001′
SQL Server Error:11
[Microsoft][ODBC SQL Server Driver][Multi-Protocol]General
network error. Check your network documentation.
When I test ODBC connection it completes successfully and I also checked permission and seems to be okey and also checked security in SQL database it has permission to connect to corresponding database. To let you know guys I recently changed the password of that machine to blank and urged my colleague to change in next login so is it because of password its not connecting. I am using TCP/IP dynamic port in ODBC connection. One thing I dont understand is that why its functioning well in all clients except one which I checked previous day before changing password it was working fine.I am using sql server 2000 and access 2003 database.
Источник
Ошибка подключения к базе 7.7 SQL
База 1С SQL. Подключается 5 ПК. На одном из них переустановили систему, установили платформу 7.7, при попытке подключения к базе выдает ошибку:
SQL State:08001
Native:17
Messeg:[Microsoft][ODBC SQL Server Driver][DBNetLib] SQL Server не существует или отсутствует доступ.
SQL State:01000
Native:2
Messeg:[Microsoft][ODBC SQL Server Driver][DBNetLib] Connection open(Connect())
Помогите разобраться, как исправить?
Причин возникновения проблем с подключением к SQL Server-у может быть много, но есть простые методы диагностики и выявления проблем подключения к серверу.
Шаг 1.
Попробуйте «пропинговать» сервер БД как по имени так и по IP-адресу, командой
Ping [SQLServerDNSName], где SQLServerDNSName – DNS имя сервера БД в сети. Если возникли проблемы с пингом по имени, то необходимо устранить проблемы со службой DNS в Вашей сети. Если сервер не пингуется по IP-адресу, то необходимо решить проблемы, либо с маршрутизацией пакетов в сети, или проверить саму сеть на наличие физических обрывов.
Шаг 2.
Выполняется при условии, что шаг 1 выполнился успешно.
Простая проверка к соединения с сервером БД осуществляется командой
telnet [SQLServerIPAdress] [port] – где SQLServerIPAdress IP-адрес сервера, port-порт подключения к серверу, по умолчанию 1433. При удачном подключении, экран терминала telnet будет чистым с мигающим курсором. При неудачном подключении необходимо проверить порт подключения к серверу. Определение настроек порта на клиенте выполняется утилитой cliconfg.exe, на сервере — утилитой svrnetcn.exe.
Шаг 3.
Выполняется при условии, что шаги 1 и 2 выполнились успешно.
Часто на этом шаге при подключении возникает ошибка «Login failed for user [UserName]», где UserName-имя пользователя, под которым вы хотите подключиться к серверу БД. При возникновении такой ошибки необходимо проверить тип авторизации. По умолчанию при установке SQL Server-а разрешена только Windows авторизация. Если Вы подключаетесь под логином sa, то Вам необходимо установить на сервере БД смешанную(mixed) авторизацию. Также необходимо проверить пароль для логина, под которым Вы подключаетесь.
Источник
Odbc error sqlstate 08001
It shows following error n
Connection could not be established. Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. ) ) n
But if I tried with n
I used to got different error Connection could not be established. Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. [message] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired [message] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) ) n
Could you get some clue? n»,»bodyInMarkdown»:»@staudenmeir I have an update now. If I test with following code. rnrn«`rn »kpi_db»,»UID»=>»root», »PWD»=>»123456»);rn$conn = sqlsrv_connect( $serverName, $connectionInfo);rnrnif( $conn ) <rn echo «Connection established.
»;rn>else<rn echo «Connection could not be established.
»;rn die( print_r( sqlsrv_errors(), true));rn>rn?>`rn«`rnrnIt shows following errorrnrn`Connection could not be established.rnArray ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user ‘root’. ) )`rnrnBut if I tried with rnrn«`rn »kpi_db»,»UID»=>»root», »PWD»=>»123456»);rn$conn = sqlsrv_connect( $serverName, $connectionInfo);rnrnif( $conn ) <rn echo «Connection established.
»;rn>else<rn echo «Connection could not be established.
»;rn die( print_r( sqlsrv_errors(), true));rn>rn?>`rn«`rnrnI used to got different error `Connection could not be established.rnArray ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. [message] => [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired [message] => [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 87 [code] => 87 [2] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )`rnrnCould you get some clue?»,»replies»:[],»user»:<«id»:121062,»username»:»ssquare»,»avatar»:»//www.gravatar.com/avatar/1864dbf01eb80adfe2a85428667a2149?s=100&d=https%3A%2F%2Fs3.amazonaws.com%2Flaracasts%2Fimages%2Fforum%2Favatars%2Fdefault-avatar-6.png»,»experience»:<«award_count»:»0″,»level»:2,»points»:»8,380″,»pointsUntilNextLevel»:»1,620″>,»achievements»:[],»reported»:null,»staff»:false,»subscribed»:false,»profile»:<«full_name»:null,»bio»:null,»twitter»:»»,»github»:»»,»website»:»»,»employment»:»»,»job_title»:»Software Engineer»,»location»:»»,»flag»:null,»available_for_hire»:0>,»dateSegments»:<«created_diff»:»4 years ago»>,»settings»:<«show_profile»:true>,»links»:<«profile»:»https://laracasts.com/@ssquare»>>,»likes»:[],»created_at»:»2018-09-21T09:22:22.000000Z»,»links»:<«delete»:»/discuss/replies/458104″,»like»:»/discuss/replies/458104/likes»,»best_answer»:»/discuss/conversations/94698/best»>,»best_answer»:false,»dateSegments»:<«createdDiff»:»4 years ago»>>,<«id»:458121,»conversation_id»:94698,»body»:»
To resolve this problem, change the Server authentication from Windows Authentication mode to SQL Server. n
To change the authentication mode to SQL Server and Windows, follow these steps: n
- n
- On the computer that is running Microsoft SQL Server, open SSMS. n
- In the Server name box, type the name of the instance of SQL Server. For default, you can use dot(.) or (local) n
- After connecting, in the Object Explorer window pane, right-click the SQL Instance and select Properties. n
- Click Security under the select a page options. n
- Change Server Authentication to SQL Server and Windows Authentication and click ok. n
- Click ok to the prompt message about changes not taking effect until the instance is restarted. n
- Right-click the SQL Instance in the Object Explorer and select Restart.nClick Yes to restart the instance and if prompted to restart the SQL Server Agent. n n
After these changes have been applied and the SQL Instance has been restarted, attempt to verify the ODBC connection with the u2018sau2019 account credentials. n
Then try to connect through n
If it successfully connected, remove port and fill other credentials. n
Also, make sure you have copied extensions to ext folder and php.ini both in apache and php folder. As one is responsible for command and other is for the server. Let me know if any error arises. n»,»bodyInMarkdown»:»To resolve this problem, change the Server authentication from Windows Authentication mode to SQL Server.rnrnTo change the authentication mode to SQL Server and Windows, follow these steps:rnrn1) On the computer that is running Microsoft SQL Server, open SSMS.rn2) In the Server name box, type the name of the instance of SQL Server. For default, you can use dot(.) or (local)rn3) After connecting, in the Object Explorer window pane, right-click the SQL Instance and select Properties.rn4) Click Security under the select a page options.rn5) Change Server Authentication to SQL Server and Windows Authentication and click ok.rn6) Click ok to the prompt message about changes not taking effect until the instance is restarted.rn7) Right-click the SQL Instance in the Object Explorer and select Restart.rnClick Yes to restart the instance and if prompted to restart the SQL Server Agent.rnrnAfter these changes have been applied and the SQL Instance has been restarted, attempt to verify the ODBC connection with the u2018sau2019 account credentials.rnrnThen try to connect through rnrn«`rn »kpi_db»,»UID»=>»sa», »PWD»=>»»);rn$conn = sqlsrv_connect( $serverName, $connectionInfo);rnrnif( $conn ) <rn echo «Connection established.
»;rn>else<rn echo «Connection could not be established.
»;rn die( print_r( sqlsrv_errors(), true));rn>rn?>rnrn«`rnrnIf it successfully connected, remove port and fill other credentials. rnrnAlso, make sure you have copied extensions to ext folder and php.ini both in apache and php folder. As one is responsible for command and other is for the server. Let me know if any error arises.»,»replies»:[],»user»:<«id»:111482,»username»:»Inquisitive»,»avatar»:»//www.gravatar.com/avatar/f94b16493814d72f235b6adabab5b1c6?s=100&d=https%3A%2F%2Fs3.amazonaws.com%2Flaracasts%2Fimages%2Fforum%2Favatars%2Fdefault-avatar-18.png»,»experience»:<«award_count»:»5″,»level»:7,»points»:»30,040″,»pointsUntilNextLevel»:»4,960″>,»achievements»:[],»reported»:null,»staff»:false,»subscribed»:true,»profile»:<«full_name»:»Saroj Shrestha»,»bio»:null,»twitter»:»»,»github»:»»,»website»:»»,»employment»:»»,»job_title»:»»,»location»:»»,»flag»:null,»available_for_hire»:1>,»dateSegments»:<«created_diff»:»4 years ago»>,»settings»:<«show_profile»:false>,»links»:<«profile»:»https://laracasts.com/@Inquisitive»>>,»likes»:[«Muhammad-Faisal»],»created_at»:»2018-09-21T11:00:04.000000Z»,»links»:<«delete»:»/discuss/replies/458121″,»like»:»/discuss/replies/458121/likes»,»best_answer»:»/discuss/conversations/94698/best»>,»best_answer»:true,»dateSegments»:<«createdDiff»:»4 years ago»>>,<«id»:458229,»conversation_id»:94698,»body»:»
For this problem, after any time of investigation with the same problem I have discovered that it is necessary that I have also installed the ODBC drivers of the Sql server, they are two components, necessary for the installationnThe SQL Server drivers for PHPnThe ODBC drivers for the database. n
To resolve this problem, change the Server authentication from Windows Authentication mode to SQL Server. n
To change the authentication mode to SQL Server and Windows, follow these steps: n
- n
- On the computer that is running Microsoft SQL Server, open SSMS. n
- In the Server name box, type the name of the instance of SQL Server. For default, you can use dot(.) or (local) n
- After connecting, in the Object Explorer window pane, right-click the SQL Instance and select Properties. n
- Click Security under the select a page options. n
- Change Server Authentication to SQL Server and Windows Authentication and click ok. n
- Click ok to the prompt message about changes not taking effect until the instance is restarted. n
- Right-click the SQL Instance in the Object Explorer and select Restart.nClick Yes to restart the instance and if prompted to restart the SQL Server Agent. n n
After these changes have been applied and the SQL Instance has been restarted, attempt to verify the ODBC connection with the u2018sau2019 account credentials. n
Then try to connect through n
If it successfully connected, remove port and fill other credentials. n
Also, make sure you have copied extensions to ext folder and php.ini both in apache and php folder. As one is responsible for command and other is for the server. Let me know if any error arises. n»,»bodyInMarkdown»:»To resolve this problem, change the Server authentication from Windows Authentication mode to SQL Server.rnrnTo change the authentication mode to SQL Server and Windows, follow these steps:rnrn1) On the computer that is running Microsoft SQL Server, open SSMS.rn2) In the Server name box, type the name of the instance of SQL Server. For default, you can use dot(.) or (local)rn3) After connecting, in the Object Explorer window pane, right-click the SQL Instance and select Properties.rn4) Click Security under the select a page options.rn5) Change Server Authentication to SQL Server and Windows Authentication and click ok.rn6) Click ok to the prompt message about changes not taking effect until the instance is restarted.rn7) Right-click the SQL Instance in the Object Explorer and select Restart.rnClick Yes to restart the instance and if prompted to restart the SQL Server Agent.rnrnAfter these changes have been applied and the SQL Instance has been restarted, attempt to verify the ODBC connection with the u2018sau2019 account credentials.rnrnThen try to connect through rnrn«`rn »kpi_db»,»UID»=>»sa», »PWD»=>»»);rn$conn = sqlsrv_connect( $serverName, $connectionInfo);rnrnif( $conn ) <rn echo «Connection established.
»;rn>else<rn echo «Connection could not be established.
»;rn die( print_r( sqlsrv_errors(), true));rn>rn?>rnrn«`rnrnIf it successfully connected, remove port and fill other credentials. rnrnAlso, make sure you have copied extensions to ext folder and php.ini both in apache and php folder. As one is responsible for command and other is for the server. Let me know if any error arises.»,»user»:<«id»:111482,»username»:»Inquisitive»,»avatar»:»//www.gravatar.com/avatar/f94b16493814d72f235b6adabab5b1c6?s=100&d=https%3A%2F%2Fs3.amazonaws.com%2Flaracasts%2Fimages%2Fforum%2Favatars%2Fdefault-avatar-18.png»,»achievements»:[],»reported»:null,»staff»:false,»subscribed»:true,»profile»:<«full_name»:»Saroj Shrestha»,»bio»:null,»twitter»:»»,»github»:»»,»website»:»»,»employment»:»»,»job_title»:»»,»location»:»»,»flag»:null,»available_for_hire»:1>,»dateSegments»:<«created_diff»:»4 years ago»>,»settings»:<«show_profile»:false>,»links»:<«profile»:»https://laracasts.com/@Inquisitive»>>,»likes»:[«Muhammad-Faisal»],»created_at»:»2018-09-21T11:00:04.000000Z»,»links»:<«delete»:»/discuss/replies/458121″,»like»:»/discuss/replies/458121/likes»,»best_answer»:»/discuss/conversations/94698/best»>,»best_answer»:true,»dateSegments»:<«createdDiff»:»4 years ago»>>,»recommended»:[<«id»:120,»className»:»LaracastsSeries»,»title»:»What’s New in Laravel 8″,»body»:»
Laravel 8 is here! This release includes brand new application scaffolding, class-based model factories, migration squashing, time traveling, and so much more. Join me as, one topic per episode, we review everything you need to know! «,»path»:»/series/whats-new-in-laravel-8″,»strippedBody»:»Laravel 8 is here! This release includes brand new application scaffolding, class-based model factories, migration squashing, time traveling, and so much more. Join me as, one topic per episode, we review everything you need to know!»,»thumbnail»:»https://ik.imagekit.io/laracasts/series/thumbnails/whats-new-in-laravel-8.png»,»large_thumbnail»:»https://laracasts.s3.amazonaws.com/series/thumbnails/social-cards/whats-new-in-laravel-8.png»,»svgThumbnail»:»https://ik.imagekit.io/laracasts/series/thumbnails/svg/whats-new-in-laravel-8.svg»,»slug»:»whats-new-in-laravel-8″,»episodeCount»:12,»difficultyLevel»:»Beginner»,»customUrl»:null,»version»:null,»version_notes»:null,»complete»:0,»wallpaper»:»»,»archived»:0,»runTime»:»59m»,»taxonomy»:<«name»:»Frameworks»,»path»:»https://laracasts.com/browse/frameworks»>,»hasChapters»:true,»isLarabit»:0,»isCreatorSeries»:0,»progress»:<«started»:false,»completionPercentage»:0,»episodesCompleted»:0,»completed»:false,»nextEpisodePosition»:1>,»lastUpdated»:»Sep 3, 2020″>,<«id»:142,»className»:»LaracastsSeries»,»title»:»Laravel 8 From Scratch»,»body»:»
rnWe don’t learn tools for the sake of learning tools. Instead, we learn them because they help us accomplish a particular goal. With that in mind, in this series, we’ll use the common desire for a blog — with categories, tags, comments, email notifications, and more — as our goal. Laravel will be the tool that helps us get there. Each lesson, geared toward newcomers to Laravel, will provide instructions and techniques that will get you to the finish line. rn rn
Источник
Today I faced a new error type that I’d never seen before in my many years of experience with SSAS. It was one of the most weird errors that I’ve seen so far.
let me explain that in a scenario; I had a SSAS multi-dimensional cube working and fully processing on the DEV server. then I just copied that to UAT server with a simple backup and restore.
I’ve changed the data source connection from DEV database engine to UAT database engine, and processed, but I’ve got a very early processeing error as below:
OLE DB error: OLE DB or ODBC error: A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.; 08001; Client unable to establish connection; 08001; Encryption not supported on the client.; 08001.
So I did my troubleshooting as steps below;
As the error says the problem is in connection to SQL Server. so I’ve checked UAT SQL Server DB engine connection and it worked both local and remote. then I compared connection configuration of UAT DB Engine server and compared it to DEV server, they were completely same. Version, edition of sql server, collations and other configuration all were exactly similar!
I’ve thought that problem might be exists in the impersonation account, and I’ve changed it with different options but no luck.
I’d opened SSDT and connected the SSAS project to UAT, and started processing. Unfortunately I’ve got same error there!
I did some google searches and I’ve found solutions like this: http://geekswithblogs.net/LifeLongTechie/archive/2012/06/21/ssas-processing-error-client-unable-to-establish-connection-08001-encryption.aspx
Which says that change the connection provider from SQL Native Client to OLE DB provider.
Solution seems to be useful in some cases – for example for the blog author and some others -, But It didn’t worked for me. I’ve tried all types of connection providers but no luck.
I’d started a trace on SQL Profiler to see which account used for the connection, and I thought that account might cause the problem. But surprisingly I’ve seen that nothing logged into SQL Profiler trace that tracked DB engine!
Then I’d changed my target SSAS server for deployment to DEV server and processed the Dev Server’s cube with data from UAT DB Engine. It was working fine! So there were no doubt for me that there should be something wrong on SSAS service instance of the UAT server.
I’ve checked SSAS server properties on UAT, every thing was fine and OK and equally similar to DEV SSAS server configuration.
Then I’ve found this blog post: http://blogs.msdn.com/b/jsocha/archive/2011/05/27/fixing-cube-processing-odbc-errors.aspx
Which says that change the SSAS Service account to a local account, and restart the service.
Before doing that I’ve just tried this one; Just restarted the SSAS Service on UAT. and then I processed the cube. That was the keystone! It processed successfully! I couldn’t believe that; I’d spend about 2 hours to figure out the problem, and it solved just with a simple SSAS Server restart!
So I’d thought that maybe it would be better to list what I’ve done in this blog post, maybe it helps some of you. I hope you could get rid of this error much faster with help of this post.
If I list required efforts to figure out the issue I say;
1- Check source SQL Server DB engine connection to work
2- deploy SSAS project to another SSAS server and see is it working or not
3- change SSAS Service account to a local one, and restart (sometime, just do the restart service!)
4- try other connection providers such as OLE DB, Native Client…
Trainer, Consultant, Mentor
Reza Rad is a Microsoft Regional Director, an Author, Trainer, Speaker and Consultant. He has a BSc in Computer engineering; he has more than 20 years’ experience in data analysis, BI, databases, programming, and development mostly on Microsoft technologies. He is a Microsoft Data Platform MVP for nine continuous years (from 2011 till now) for his dedication in Microsoft BI. Reza is an active blogger and co-founder of RADACAD. Reza is also co-founder and co-organizer of Difinity conference in New Zealand.
His articles on different aspects of technologies, especially on MS BI, can be found on his blog: https://radacad.com/blog.
He wrote some books on MS SQL BI and also is writing some others, He was also an active member on online technical forums such as MSDN and Experts-Exchange, and was a moderator of MSDN SQL Server forums, and is an MCP, MCSE, and MCITP of BI. He is the leader of the New Zealand Business Intelligence users group. He is also the author of very popular book Power BI from Rookie to Rock Star, which is free with more than 1700 pages of content and the Power BI Pro Architecture published by Apress.
He is an International Speaker in Microsoft Ignite, Microsoft Business Applications Summit, Data Insight Summit, PASS Summit, SQL Saturday and SQL user groups. And He is a Microsoft Certified Trainer.
Reza’s passion is to help you find the best data solution, he is Data enthusiast.
- Remove From My Forums
-
Question
-
Hi Friends,
I am working on .Net Framework 2.0 Whenever I connect to sql 200 database this gives an error. this error is as follows.
ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
If anybody know then please let me know, why this error comes and how it will be resolved.
Thanks & Regards
Brijendra Pandey
Answers
All replies
-
Ans
1. Version thats i am using is Sql 2000, without any service pack
2. Remote connection is enabled. I am able to connect from this machine by SQLWB
3. The connection string i am using is «Server = Training or Ip of System; Database = db_name; user id =asdf; password = fasdf «.
or «Data Source = Training or Ip; Database = db_name; uid = sdfa; pwd = dasfdf;»
4. User also has right to access that database.
-
I’m assuming you didn’t read the blog? You really should, it has some good general guidance.
1) Are you trying to connect remotely? If so, disable your temporarily firewall and see if this helps.
2) I’m not a connection string expert but go to www.connectionstring.com and use one of theirs. This will help ensure it’s not a connection string issue.
3) No SPs installed? You might want to try installing those.
-Tres London
-
Connection String Passed
«Server=servername;Database=db_name;User ID=sa;Password=pwd;Trusted_Connection=False»
-OR-
«Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;»
-
Hello,
I’m having the same problem with this topic, I have done the tests that were mentioned in the blog.
I have two databases on the same server for different programs.
the machine in question I can use a program, but trying to use the SAP it’s wrong image attached.
http://www.postimage.org/image.php?v=gx3y_6A
Can anyone help me?
Thanks