Excel connection to database, problem when shared in One Drive - sql-server

Not sure if this is the correct forum but here goes. Very new to databases so apologies ahead of time if I don't provide enough info.
I have a Microsoft SQL Server Database created with Microsoft SQL Server Management Studio 18, I connected Excel to it to analyse the data and saved that workbook in a shared One Drive folder. Works fine on my computer but the other users cannot refresh the data from the database. I've exhausted all my online search options to figure out how to fix this. I don't know if the database is on a cloud server or if that matters.
Error message is; [Datasource.Error] Microsoft SQL: A network related or instance specific error occurred while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider; SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
The database does allow for remote connections, I checked that.
I'm comfortable with Excel but I'm new to databases, only worked with Access in the past. Anyone know of the "best" way to have a database we can all (4 users currently) connect to while also connecting Excel to it.
I don't understand the pricing plans for Azure, AWS etc. plus they seem to be way more than what I need.
Doesn't have to be a free option but a set monthly fee with no surprises would work if a server is the issue. It's a relatively small amount of data, currently maybe 100 rows, 24 columns.
The option I last came across was Godaddy web hosting had a database option, don't if this is a good option or not. I signed up for Elephantsql but I haven't figured out how to use that to host the database, creating one in elephant itself seems to use only code rather than the way I created the database in Microsoft.
Thanks in advance for any help, going to go close my 25 google search tabs now.....
Kevin

do you realy need an SQL-Server for dataset auf 100 rows and 24 columns?
I would try do store the date in a shared Excel-File in Onedrive an connect to this.
Best regards
Chris
EDIT
If you want to connect to Private-OneDrive File you should use a WEB-Connector instead of a "File"-Connector.
Your Source should be like this:
=Excel.Workbook(Web.Contents("https://onedrive.live.com/download?resid=AAAXXXXAAA&authkey=BBBXXXXBBB&em=CCCXXXXCCC&app=Excel"), null, true)
You have to replace the AAAXXXXAAAA; BBBXXXXBBB and CCCXXXXCCC with informations from the embedded-link of your XLSX-File:
1) open OneDrive in WEB
2) Select you file and right-click
3) click "embedded"
4) in the right pane you find the embedded-link
5) find there the resid; authkey and em
OneDrive GetEmbeddedLink

Related

Database and Dataset data is empty [duplicate]

Apparently, using AttachDbFilename and user instance in your connection string is a bad way to connect to a DB. I'm using SQL server express on my local machine and it all seems to work fine. But what's the proper way to connect to SQL server then?
Thanks for your explanation.
Using User Instance means that SQL Server is creating a special copy of that database file for use by your program. If you have two different programs using that same connection string, they get two entirely different copies of the database. This leads to a lot of confusion, as people will test updating data with their program, then connect to a different copy of their database in Management Studio, and complain that their update isn't working. This sends them through a flawed series of wild goose chase steps trying to troubleshoot the wrong problem.
This article goes into more depth about how to use this feature, but heed the very first note: the User Instance feature has been deprecated. In SQL Server 2012, the preferred alternatives are (in this order, IMHO):
Create or attach your database to a real instance of SQL Server. Your connection string will then just need to specify the instance name, the database name, and credentials. There will be no mixup as Management Studio, Visual Studio and your program(s) will all be connecting to a single copy of the database.
Use a container for local development. Here's a great starter video by Anna Hoffman and Anthony Nocentino, and I have some other resources here, here, and here. If you're on an M1 Mac, you won't be able to use a full-blown SQL Server instance, but you can use Azure SQL Edge if you can get by with most SQL Server functionality (the omissions are enumerated here).
Use SqlLocalDb for local development. I believe I pointed you to this article yesterday: "Getting Started with SQL Server 2012 Express LocalDB."
Use SQL Server Compact. I like this option the least because the functionality and syntax is not the same - so it's not necessarily going to provide you with all the functionality you're ultimately going to want to deploy. Compact Edition is also deprecated, so there's that.
Of course if you are using a version < SQL Server 2012, SqlLocalDb is not an option - so you should be creating a real database and using that consistently. I only mention the Compact option for completeness - I think that can be almost as bad an idea as using AttachDbFileName.
EDIT: I've blogged about this here:
Bad Habits : Using AttachDBFileName
In case someone had the problem.
When attaching the database with a connection string containing AttachDBFile
with SQLEXPRESS, I noticed this connection was exclusive to the ASP.NET application that was using the database. The connection did block the access to all other processes on the file level when made with System.Data.SqlClient as provider.
In order to assure the connection to be shareable with other processes
instead use DataBase to specify the database name in your connection string
Example or connection string :
Data Source=.\SQLEXPRESS;DataBase=PlaCliGen;User ID=XXX;password=ZZZ; Connect Timeout=30
,where PlaCliGen is the name (or logical name) by which SQLEXPRESS server knows the database.
By connecting to the data base with AttachDBFile giving the path to the .mdf file
(namely : replacing DataBase = PlacliGen by AttachDBFile = c:\vs\placligen\app_data\placligen.mdf) the File was connected exclusively and no other process could connect to the database.

Siteground SQL Database to Power BI

I would like to connect my SQL Database on Siteground Hosting to Power BI through the SQL Server connection. However, I need to get the following information which I am not sure where to get:
Siteground Database Credentials in the format: servername:portname
Username & Password (which I have)
And finally, when I inserted the IP Address in item no.1, the error received is as below:
Based on the error above, I figured it could be either:
(i) the IP address I have inserted is wrong; or
(ii) I need to allow remote access to my database on Siteground CPanel:
If item (ii) is the reason for the error, in order to allow PowerBI to access the database, I would need to insert the IP Address of my PowerBI Online which I do not know how to get
I need assistance basically connecting my PowerBI application to my SQL Database created on my hosting account Siteground
Any help is much appreciated.
Your Siteground control panel suggest that the database is MySQL - your are trying to connect to a SQL Server database. They are not the same thing which is probably why it doesn't work.
Try using the MySQL connector for Power BI
First, as Martin Cairney told you, the connector that you are using is wrong - Microsoft SQL Server and MySQL are completely different products, which are not compatible. First change the connector.
The list of IP addresses is something dynamic. There is no guarantee, that Power BI will try to connect to your database from a single IP address only, nor that this IP address will stay the same for a long time. If you go this way, you should maintain this on a weekly basis and monitor for changes. The list of IP addresses can be downloaded from these json files:
Public: https://www.microsoft.com/en-us/download/details.aspx?id=56519
US Gov: http://www.microsoft.com/en-us/download/details.aspx?id=57063
Germany: http://www.microsoft.com/en-us/download/details.aspx?id=57064
China: http://www.microsoft.com/en-us/download/details.aspx?id=57062
They are updated weekly.
Better solution is to move your database to Azure (e.g. Azure MySQL service or MySQL installed in Virtual Machine in Azure) or to migrate to another data source.

Connecting to sql database

(I am a sql noob and I just can not figure this out on my own)
For some time now I have been trying to establish a connection to a SQL database in codename one but to no avail. First I tried connecting to a MariaDB database from one.com. All that's needed for the connection is
Database db = Display.getInstance().openOrCreate("databaseName");
if I am not mistaken, but I am guessing this implies that I have somehow already established a connection to the database. This is not the case however so it creates a new .sql file, right? I can recall that you can connect to a database in the services tab in Netbeans. I chose the MySQL(Connector/ J Driver) which should work with MariaDB, or should it? I entered all my data and i says that it can not establish connection to the database.
the error i get
So I thought I might as well try using localhost. I used XAMPP to host a database and connected in the netbeans services tab.
connected?
Now testing was needed to see if this works. I started the SQL journey with this https://www.codenameone.com/manual/files-storage-networking.html#_sql and integrated the part after "You can probably integrate this code into your app as a debugging tool". I changed database name to "mybase" (it's existance can be confirmed in picture 2). Ran the app, opened the dialog, entered "select ID from customers" and got: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: customers) It does not get past the first call to "executeQuery". The customers table definitely exists so what am I missing to establish connection?
I really need instructions to connect to the localhost database and ideally also to the one hosted by my webhost provider.
Thanks,
Jona
The Database class is to access the SQLite DB on the mobile device. To connect to external databases, you'd have to do something different, such as a ConnectionRequest or Socket I think.

SQL Server error cannot open database

Helo fellow, sorry for being annoying u again =P.
Today a got a mission in the job... ¬¬'
Our system works integrated to SQL Server. There were two databases. The main one, and another "responsible" for doing some data integration stuffs...
One day, the boss decided not to use the second database anymore, and ordered the team to create a fix application that unlinked these databases. But in one of our clients the SQL Server is givin' an error message:
-[Microsoft][ODBC SQL Server Driver][SQL Server] Database 'XXX' cannot be onpened due to inaccessible files or insufficient memory or disk space.
I've checked the disk space and it's fine. The memory amount is ok too. And the database files, doesn't exist anymore in the SQL data folder (like we expected and the boss desired).
This error could be expected if the were references in the sql server, but the database is not atached anymore, the table 'sysdatabases' in the master database doesn't references the database...
Someone can give a clue? I'm previously thankful for any help. =)
Sounds to me like the client is running an old version of the code which is still trying to connect to the database that's been unlinked.

How can I properly link my SQL Server database to an Access form and distribute it to the network and have them input information?

When I link the Microsoft Access to SQL Server locally, everything works. The second I go to a computer that is on the network, I am not able to open the form I created on the Access database.
I found out that if I open the link, I will get an error. If I choose where the DB through configurations in Access, I get the error again. If I try this a third time, it connects to the database and it is fully linked--I am able to type data into Access and it will store it in the SQL Server database as well.
My question is: How do I get it to connect to the server on the first try? I have to hit "connect" three times which takes about 5 minutes to log in. That isn't very efficient when the people using this program nothing about computers.
Linking Access to SQL Server uses ODBC. Make sure your ODBC settings are correct.

Resources