I use vb.net and windows form and sqlserver
I added Data Source(Microsoft SQL Server (SqlClient)) to my project. and now I need to change it to ODBC Data Source .
How Can I do That?
thanks
See these resources - you cannot simply change your SqlClient/SqlCOnnection - you need to use OdbcConnection instead:
Connecting to an ODBC Data Source Using ADO.NET
ADO.NET ODBC connection in VB.NET
ODBC is a technology several generations older than ADO.NET/SqlClient - why do you want to "downgrade" back into the dark ages?? What are you trying to achieve that you cannot do using SqlClient?? If you really must connect to a multitude of different datasources, I would strongly recommend using / investigating OleDB instead of ODBC. ODBC is really quite old, and e.g. doesn't have any 64-bit capable drivers.... OleDB does!
See the Wikipedia article on OleDB, and view impressive lists of OleDB data providers here and here for some insights.
Related
How does one properly establish a connection string for integrating a macro-enabled PowerPoint to be able to query an Oracle database? I have seen many old youtube videos and online tutorials regarding this (mostly in excel), but the connection string appears differently in each one. I am using a 64 bit Windows machine and an Oracle database that I usually access through SQL Developer.
A reference link that appears to be in the right direction:
http://learnexcelmacro.com/wp/2011/11/oracle-connection-string-in-vba/
I am trying to use a connection with the service, so it should look something like this:
The only changes that I have personally made to the connection string are:
HOST is Hostname founder in SQL Developer instance properties
Port is Port in SQL Developer instance properties
Uid is username in SQL Developer instance properties
Pwd is password in SQL developer instance properties
I have left all other fields unchanged. It should be noted that I do in fact have Tools>References>Microsoft ActiveX Data Objects 2.8 Library
I understand that inside of SQL Developer you can view the properties for a database instance connection. Is all the information there to construct my connection string? I cannot get the connection string to work and I am constantly met with errors.
Thanks!
There are several drivers available to connect to an Oracle database from VBA.
Common are ODBC Driver, either from Microsoft or from Oracle or the OLE DB provider. OLE DB provider are also either from Microsoft or from Oracle. There are even a few more from 3rd party (see How to connect to Oracle 11 database from . net), but lets keep it simple.
Depending on which driver you choose, the connection string is different:
ODBC Driver from Microsoft: Driver={Microsoft ODBC for Oracle};...
ODBC Drvier from Oracle: Driver={Oracle in OraClient11g_home1};... (or similar)
OLE DB Provider from Microsoft: Provider=MSDAORA;...
OLE DB Provider from Oracle: Provider=OraOLEDB.Oracle;...
For details have a look at Oracle Connection Strings or Connection String Home Page
All these drivers/providers require at least an Oracle Instant client installed on your machine. When your PowerPoint is 32-bit then also the Oracle client and as well the driver/provider must be 32-bit. When your PowerPoint is 64-bit then all other components must be also 64-bit - you cannot mix 32-bit and 64-bit.
The Oracle drivers provided by Microsoft are deprecated for ages, they are not available for 64-bit! So, when you have a 64-bit Office then {Microsoft ODBC for Oracle} and MSDAORA are out of the game.
I'm trying to get data from api and insert them into a SQL Server .sdf database file, but I'm not sure how to do it especially that I'm using Windows forms on Visual Studio 2010
Can someone help me ?
This is a very broad question, however, at a very high level, you will need to open up a connection to the SQL Server Database and use a data access technology such as ADO.NET or EntityFramework to work with the objects in the database.
See the answer in this thread for an example of working with ADO.NET.
This is my first post in here,
I am new to SQL and I started learning it, I use it mainly in excel to get data from an outer Database
I first go to data then Refresh all then from the menu I choose connection properties
Then a dialogue appears and I input my code in the window called Command text from the Tab Definition
I added images to show where I input my SQL code
My question is what type of SQL do I input there ?
is it mySQL or SQLServer or what ??, so I can learn it, because some commands just don't work with me the way they are supposed to do
You can connect to any database type as long as you have the appropriate ODBC drivers. For example, here is documentation for MySQL for Excel. Quote from article "Use Microsoft Query to retrieve external data":
If the external database that you want to access is not supported by the
ODBC drivers that are installed with Microsoft Query, then you
need to obtain and install a Microsoft Office-compatible ODBC driver
from a third-party vendor, such as the manufacturer of the database.
Contact the database vendor for installation instructions.
OLAP databases do not require ODBC drivers. When you install Microsoft Query, drivers are installed for databases that were created
by using Microsoft SQL Server Analysis Services. To connect to other
OLAP databases, you need to install a data source driver and client
software.
Whichever database type you connect to, you will still be using Microsoft's SQL variant (as developed for SQL Server). As a beginner you're not going to notice too many differences right off the top. Most of the differences are related to data types, such as DATE vs DATETIME. Here is a wiki on SQL Compliance and this article on MS Access SQL will also apply to Excel Query.
You can connect to many data source including: SQL Server database, Access database, MySQL database, PostgreSQL database etc..
You can find the full list here: Link
How to read data, submit queries from vb application to a remote machine running sql server.
Please note: I have created a complete functional version of a stock control system with the database residing in the local machine. I just need the basic concept of interacting with remote databases that's all. Do we have to use sockets to read/send data ?
All you need to do is change your connection string to the remote db server and make sure that the server is actually listening. (Link assumes 2005 but 2k, 2k8+ config will be similar and easily Googled for...) You definitely DO NOT have to write special code for this.
Check out http://connectionstrings.com/ for a handy reference for the different types of connection strings in different situations.
Are we talk about .NET version of VB or old fashioned VB 6?
In .NET version of VB (VB.NET) you can use OLEDB Data adapter, ODBC Data Adapter or native .NET Data adapter depends on your needs.
See MSDN documentation enter link description here
In VB6 version, you can use ADO, OLEDB or ODBC. See documentation here: http://msdn.microsoft.com/en-us/library/aa968814(v=vs.85).aspx
I don;t recommendate to connect your application via socket by yourself because this is really bloody coding.
I would like to know if it is possible to Transfer Data into SQL Server from a multi value database file using SSIS.
The only thing that I could find online was using a bluefinity tool to achieve this.
Thanks
Simona
I have done this from Universe, but Universe has an ODBC driver that allows the datavase to be viewed as if they were tables. Almost like SQL views.
SSIS can import from almost anything that you can get either a .Net, ODBC, or OLE DB driver for. There has to be someway to talk to the DB from an extrnal program, though.
I suspect that you has no driver (ODBC,OLEDB,.NET). So you can use C# script (even from SSIS) and extract data to flat file and then to SQL Server or do it directly to SQL Server.