How to Authenticate to MS SQL with a MS Access Form [closed] - sql-server

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have an MS Access 2013 Front end application that links tables to a MS Sequel Server Back end. When the user starts the application a dialogue box is asking for the SQL authentication.
I would like to provide a nice looking form to have the user login and pass that to MS Sequel.
How do I get the data from the form and pass it to MS Sequel or to the DNS that I am using.
Thanks
Todd

You can have a default form pop up, and after they've input their credentials you would pass the login info to SQL like so:
Dim cnComments As New ADODB.Connection
Dim strConn As String
'Set up the connection string
strConn = "PROVIDER=SQLOLEDB;DATA SOURCE=YourServerName;
INITIAL CATALOG=YourDatabaseName;
UID=FormUserName;PWD=FormPassword;"
cnComments.Open strConn

Related

I'm having an issue sending a notification to my email after I execute a stored Procedure in my SSIS Package [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I am getting an issue with the SMTP connection it keeps on saying Client not authenticated. I have set the SMTP Server to smtp.gmail.com and enabled the SSL layer socket. My connection string is below.
smtpServer=smtp.gmail.com;UseWindowsAuthentication=False;EnableSsl=True;

Connecting to sql server named instance using gorm erroring out with invalid character "\\" in host name [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I am trying to connect to a locally running sql server developer instance from golang using gorm library using the below connection string
"sqlserver://trusted_connection=yes#localhost\MSSQLSERVER02:1443?database=operationsdb"
but getting the below error
parse sqlserver://trusted_connection=yes#US71DX930J\MSSQLSERVER02:1443?database=operationsdb: invalid character "\" in host name
If this is the Go MSSQL driver you're talking about, try using " / " for the named instance instead of a " \ " backslash:
"sqlserver://trusted_connection=yes#localhost/MSSQLSERVER02:1443?database=operationsdb"
https://github.com/denisenkom/go-mssqldb/blob/master/README.md

How does an application connect to a SQL Server database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
So at my workplace we have many applications that we use and a lot of them have their own server for the application itself and a separate server for the database of that application which can be managed in SSMS.
I was just wanting to know, how does an application connect to a SQL Server database? Like for example, when entering in information into the application, how does it get updated and put in the database on a different server than the application itself?
SQL Server has a protocol called TDS: Tabular Data Stream, which ultimately is used to connect to the server over the network.
Several different drivers implement this and present different interfaces to applications depending on their preference and standards etc.
https://learn.microsoft.com/en-us/sql/connect/sql-server-drivers
To piggy back off of #Cade Roux's answer, I will try to explain how a programmer would connect and execute SQL queries to the server. I'm going to assume that because you are using SSMS, then your company is full .Net stack. I will use C# as the programming language for the demo. Please bare in mind that this is a high level explanation and is not to be used as best practice.
An application will need two things to execute a SQL query: the connection string, and the SQL command to be executed. The following is sample code:
...(other code)...
string queryS = #"Update myTable Set sqlField = 'datatoupdate' Where otherSqlField = 'whyweareupdatingthisrow'";
string connS = #"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;";
CreateCommand(queryS, connS);
private static void CreateCommand(string queryString,
string connectionString)
{
using (SqlConnection connection = new SqlConnection(
connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
command.Connection.Open();
command.ExecuteNonQuery();
}
}
'queryS' is the query string. I'm assuming you are familiar with this as you have used SSMS.
'connS' contains the connection string. This is what allows an application to open a connection and execute a SQL query with a database. Within it, you can see that the server and database names are provided, as well as what credentials are needed (same ones used to access the database via SSMS). This allows an application to access a database, even on a different server. Note that this is just a generic connection string and other parameters can be passed into it as well.
The remaining logic calls a function that opens the connection and executes the query.
Additional information on SQL queries using C# can be found here.

SQL Server Compact connection [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I created a SQL Server Compact database file aa.sdf and I am trying to connect it to my VB.NET code. But it can not connect to it
Dim MyConnexion As SqlConnection = New SqlConnection("Data Source=C:\Users\W8\Documents\aa.sdf;" & "Integrated Security=SSPI;Initial Catalog=toto")
Dim Requete As String = "Insert into toto(ID, sumAp) values (11,22)"
Dim Commande As New SqlCommand(Requete, MyConnexion)
MyConnexion.Open()
I get this message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
I am a beginner at SQL...
My table is toto:
ID sumAp
1 11
2 21
Thank you
To connect to Compact Edition databases, you need to instead use SqlCeConnection (in the System.Data.SqlServerCe namespace, if you haven't already imported it), so instead, I'd expect your code to look a little like:
Using con As New SqlCeConnection("Data Source=C:\Users\W8\Documents\aa.sdf;Integrated Security=SSPI;Initial Catalog=toto")
con.Open()
Using cmd As New SqlCeCommand("Insert into toto(ID, sumAp) values (11,22)", con)
cmd.ExecuteNonQuery()
End Using
End Using

PostgreSQL - FATAL: Ident authentication failed for user "myuser" [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I just installed PostGreSQL in my Ubuntu Box, and the first thing I want to do is to create a database. I read the documentation, and it simply says type createdb. Once I typed in that command, PostgreSQL gave me an error: could not connect to database postgres: FATAL: Ident authentication failed for user "myuser". I assume that this is because "myuser" does not have the right administration privileges in the database. Is there an easy way to add that priviliges ?
Thank you.
The postgresql usually creates a default user postgres. You would have entered a password during installation for this user. If you remember you can use it.
Otherwise, you can add an entry in the pg_hba.conf file to enable your localhost to login without any password for psql command.
A sample entry would be
host all all 127.0.0.1/32 trust
Perhaps, create a user first?
http://www.postgresql.org/docs/8.1/static/app-createuser.html

Resources