DB/Reporting :: Connection String Not Hardcoding Passwords In Code

Aug 1, 2011

I've been working with VB6, 2003, 2005 and 2010 and I've always hardcoded my database passwords. Recently we ran into a problem where we would like to change all our db passwords for audit purposes. The problem is passwords for different dbs have been hardcoded in all our programs. How can I create programs going forward without hard coding the passwords in? I think I should be using a config file of some sort, but not sure how or where to start.

View 1 Replies


ADVERTISEMENT

DB/Reporting :: Change A Connection String?

Jul 23, 2008

I have created a very simple Visual Studio .net 2002 VB# program. It consists of form1 containing a DataGrid bound to an Access 2007 Database using OleDbConnection1, OleDbDataAdapter1 and DataSet11.The location address of the Database will change based on the user so, I need to make the connection string variable. Problem is inserting the following string variable "source=" & strFileLocation & ";" creates a fatal error

View 1 Replies

DB/Reporting :: Rdp Connection String From Database?

Sep 24, 2009

I have just written an application for myself and a few other users to use .rdp to connect to a number of servers, by clicking on the appropriate button. In the full version of the program I have two sets of connections one for when we are inside our vpn, which uses local ip addresses and DNS names; and the other which uses the external IP addresses and DNS names.This works quite well; if the user has stored credentials on their pc for the connection they connect straightaway; and if they don't the .rdp dialogue opens up with the server name/address filled in, ready for them to edit the rest of the required information.The problem for me is that this means I have to code 43 different Private Subs and then link the buttons; and I was hoping that instead of individually coding each connection, I could get the users to:Select by an option button whether the connection was internal or external

View 3 Replies

DB/Reporting :: Connection String Property Has Not Been Initialized

Mar 3, 2008

I have been given the task of debugging someone else's program. It previously ran flawlessly on a 32-bit Windows XP system, but now we are steadily switching over to 64-bit systems and this program has "spit the bit" so to speak.

This is App.Config.xml
Code:
<configuration>
<appSettings>
[Code] .....

The problem is I don't know my alternatives are. System.Configuration.ConfigurationMananger.AppSettings doesn't work.
I've tracked the problem to the last line Con.Open().
Code:
Public Function get_quotes(ByVal strDBConnection As String) As DataSet
Dim con As SqlConnection = New SqlConnection(strDBConnection)
Dim strQuery As String = "SELECT qmpQuoteID FROM Quotes"
Dim da As New SqlDataAdapter(strQuery, con)
Dim dsQuotes As New DataSet("quotes")
Try
con.Open()

The error is "The ConnectionString property has not been initialized."

View 3 Replies

Add Password To Connection String In Code?

May 24, 2011

Using VS2010 I am adding a new data source (SQL Server for this app). The wizard asks if I want to include sensitive information (e.g. the password). In this case I answer "no" ecause I don't want the password showing up in the Config file (the rest of the string is fine).

View 6 Replies

VS 2008 Access To Passwords Hidden In Code

Apr 19, 2010

I`m developing an application working on a SQL database.if I put in my code a login and a password to a database, if anybody could retrieve it from the compiled application?

View 9 Replies

Assign A My.Settings.Item Connection String To Cmd.Connection Connection String Value?

Aug 25, 2009

How do I assign a My.Settings.Item connection string to cmd.Connection connection string value?

Dim cmd As New SqlCommand()
cmd.Connection = My.Settings.Item("csStaffHoursWorked")
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "spSaveDeltekImport"

View 3 Replies

The Connection String Could Not Be Found Or Data Provider Associated With The Connection String Could Not Be Loaded

Mar 11, 2010

I got this Error Message while I try to preview the records in Dataset Designer:"The connection string could not be found or Data provider associated with the connection string could not be loaded"

Here is my dataset.xsd code

<Connections>
<Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="loginConnectionString1" IsAppSettingsProperty="true" Modifier="Assembly" Name="loginConnectionString1 (MySettings)"

[code]....

View 7 Replies

Editing The "Connection String" In The Configuration File By The Code?

Oct 12, 2010

How To Editing The "Connection String" in the Configuration file by the Code in the Run time

View 1 Replies

How To Create X Number Of Threads Without Hardcoding

Sep 24, 2010

[code]How do I create X number of threads without hardcoding?Eg. user decides the number of threads

View 1 Replies

Open An External EXE From Within Vb Net Without Hardcoding The Path To The .exe?

Jun 9, 2010

Start("Program.exe")
This does not work
Nor thisSystem.Diagnostics.Process.Start("Program.exe")

Only this works...but I can't use the Drive path..cannot hardcode it.

System.Diagnostics.Process.Start("C:Program FilesX-ProgramProgram.exe")

So how do I start an outside Exe file from within vb net without hardcoding the path.

Vb net 2008

View 9 Replies

Display Connection Properties Dialog For Connection String Browsing(for Database) In Run Time?

Feb 5, 2010

Is there a way to display the connection properties dialog for connection string browsing(for database) in run time?

As I want the user to be able to connect to various database using the GUI.

View 6 Replies

Winforms - .net Connection Entity Framework Connection String Security?

Sep 3, 2011

I understand the possibilities for encrypting a connection string in .net v4. I have a win forms application that will be used by multiple people on different machines. I understand that I need to protect the connection string at time of the app being first run on the target machine. However I am concerned that for a period of time my connection string will be unencrypted. I am looking for advice in how to deploy my app with the connection string already encrypted or encrypted during installation. encrypting the connection string in a secure way?

View 1 Replies

DB/Reporting :: Slow Connection Using ADO?

Apr 11, 2008

i know this question was asked a couple of years ago by TheMinistered .. but i cannot find an answer, and i have exaclty the same problem (using both VB6 and VB.net 2003) :

When I attempt to connect to a remote SQL server via ADO it takes almost 20-30 seconds before Open returns. I don't know if it's something I'm doing wrong... here is my connection string/code:

Private Sub Class_Initialize()
Dim strConnectionString As String
Set m_objConnection = New Connection

[Code]......

View 5 Replies

Invalid Connection String When Modifying Tableadapter Connection?

Jan 19, 2011

I'm developing an app in vb.net (visual studio 2008). I have a Teradata back-end that will be supporting multiple users in a production environment. I need to use variables in the connection string as the user/pass will be changed every 3 months.

For the gist of the application:

In it's most basic form - I have a search form which works correctly - it pulls results into a listbox and the user then double clicks the list box which will then open a form that is bound via table adapter to the back-end table (Teradata). My connection string is fine everywhere in the application. My problem is using a modified connection string for the "fill" function of the table adapter once the form is opened.

I'm using the code below for the on-load event and keep getting an "invalid connection string" - again, the connection string works fine everywhere else in the app, and the variables etc... are working correctly.

Private Sub adaptertest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DBConnStr As String = "Provider=TDOLEDB;Data Source=TDDEV;Persist Security

[Code].....

View 5 Replies

Mdb Connection - Transfer File Path In Our Connection String

Aug 26, 2009

I'm facing a problem after installation any software setup that has a database in access(mdb file) How to I transfer file path in our connection string.

View 3 Replies

Update Active Directory Without Hardcoding Username/password

Jan 20, 2011

Currently, users log into a web application with their AD (active directory) credentials which are validated against the AD. Once inside the application, certain users will need to update the AD. When I hardcode a username/password, I am able to update the AD, however when I try to force the object to use the logon credentials or if I don't specify the username/password, it throws an error. Obviously due to security concerns, I do not want to hardcode credentials.

Error - System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.

Public Shared Sub SetProperty(ByVal de As DirectoryEntry, ByVal propName As String, ByVal propValue As String)
If Not propValue Is Nothing Then

[Code].....

View 1 Replies

DB/Reporting :: Access Connection Strings?

Sep 12, 2011

I have been struggling with the construction of an Access connection string. Here's the problem.My Visual Basic 2008 project is located in a disk partition on my hard drive that I have named S:. My Access MDB file is in the same location.When I deploy the application it obviously will not be in an S: drive on the user's machine. My concern is that if I construct the Connection String using the file designations on my computer as:

(Provider =Microsoft.Jet.OLEDB.4.0; Data Source =S:MyApplicationmydatabase.mdb; User Id =admin; Password =

The deployed application won't know where to look for the data file. I know there are some shortcuts that will allow me to construct the connection string, but I do not know either the designated names or where to find them.

View 1 Replies

DB/Reporting :: Check If Sql Connection Is Good?

May 31, 2009

I have a little problem with checking if a sql connection is good.

Attached here i have a simple vb.net program that should check if the sql connection to the sql server is good. If i just run it once it works very well. But if i use it in a timer and check the connection to the sql server every 10sec it will only tell me that the connection is good (V=0).

I have tested the code with turning of the sql server service.

Dim connect As String = "Server=192.168.1.2;Database=Test;User ID=sa;Password=12345;Trusted_Connection=False"
Dim sqlconnection As New System.Data.SqlClient.SqlConnection(connect)

[Code].....

View 6 Replies

DB/Reporting :: Connection Error With SQLCE

Jun 3, 2009

I get an error using the connection string (url...) to connect to my SQL CE saying that "Provider 'Microsoft.SqlServerCe. Client.3.5' is not registered in the local PC.".In my project I have a table connected (with the wizard) to the same database and it works fine, but when i try to connect with my own code it FAIL. [code]

View 1 Replies

DB/Reporting :: Connection To A Remote Database

Feb 17, 2009

I have a problem with the connection to my database. It's on a remote server, and this is my code:

[Code]....

View 7 Replies

DB/Reporting :: DataGridView Populate With SQL Connection?

May 14, 2010

I'm connecting a MS-SQL remotely with VB2008 Express.I defined two different methods - the first one is copied from my old VB6 application, which is working perfectly.In this application, the retrieved data is added to a listview control, not datagrid!

Code:
Dim myconn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
myconn = New ADODB.Connection

[code]....

The SQL query contain several table, thus I used a "*" instead for the table name- not sure this is correct?

Code:
da.Fill(ds,"*")

View 4 Replies

DB/Reporting :: IDataReader And Connection Open?

Dec 28, 2010

In our application we use IDataReader which actually call function from one.dll where weExecureDataReader()
We have many calls in application and in some places For some reason I am getting error message "DataReader already open" but I am not sure where.What will happend if I simple close that conection in the that .dll? Am I going to make trouble to database because one datareader left opened? I assume closing connection will close reader too and gargage collector will manage that left opened datareader..

View 2 Replies

DB/Reporting :: Manage Connection After Search?

Aug 8, 2009

I am trying to use RAP (rabid application development). So I have created a database with a datagridview to show all information and textboxes to modify the informations. So far so good.

The problem is created when I try to use the search facility on the datagridview. The search is working but the problem is that the textboxes are not following the search criteria . I can configure this manual but I would like to know which is the easier way to configure the textboxes to show the value of my search criteria.

I also want to know how when I finished with the search criteria and empty the search the text boxes to make the connections back as they were before.

View 1 Replies

DB/Reporting :: SQL Connection Open/close?

Dec 16, 2011

SQL connections confuse me sometimes In almost every SQL related code on the internet the routine is like this;

* Open connection
* Execute SQL command
* Close connection

Is it good practice to just open a connection when the application starts and use that connection until the application closes?I know that sequential connections are required when processing more queries, but what if I need to poll a certain Table every x seconds? Isn't is better to keep that single connection open for as long as the application is running (and re-open when a failure occurs) instead of opening a new connection every x seconds?

View 2 Replies

DB/Reporting :: SQL Connection/ Connecting From VB 2008 App

Aug 24, 2011

We have developed a VB 2008 app that uses SQL Server 2005 Express to store data collected by this app. This app has been designed to allow multiple connections to the one centralized database.

I have ran a few tests, and confirmed that if one computer running our app is accessing a database residing on a different computer,and the network connection between two computers has been severed, it would take approximately 3.5 minutes before I would get a connection timed out exception error from within my code.

I have deliberately set the ConnectTimeout property in the SQL connection string to be 15 seconds. But some how, SQL database engine still retries until approx. 3.5 minutes later.

My thinking is that I have a subroutine that would attempt to open a database once a minute.If the open attempt is not successful, and resulted in an exception, then I would popup a message to notify the user that the connection is not available.

Doing it this way, I have confirmed that it would take about 1.5 minutes for it to re-establish the connection, once the actual network connection has been restored.

To make the long story short, I would like to find a way to shorten the detection for a broken connection, and let the user know sooner, rather than locking up the app during the 3.5 minutes period has elapsed, and at the mercy of the SQL database engine to timeout. And why would it take 3.5 minutes to timeout the connection attempt when I had explicitly use 15 seconds in my connection string?

View 2 Replies

DB/Reporting :: SQL Database Connection Test?

May 6, 2008

I am new to Visual basic and am using visual basic 2008 to write programs in, I have setup a database connection and the connection string is currently stored in the settings section of the project.I would like to have a menu item where when the user selects "test database connection" it will run the sub for testing if the database is established.

View 2 Replies

DB/Reporting :: Sql Express Close Connection?

Sep 29, 2010

I have an SQl Connection: Con

con.close

after I close the connection I cannot copy the Sql Express Db because it is still in use but I have CLOSED the connection.

View 2 Replies

.net - What Is The Connection String For Oledb Connection To Connect DSN

Mar 18, 2012

I am trying to connect DSN from my VB 2008 project. When i try using myoledb.connectionstring="DSN=myDNSname" I get the following error message An OLEDB provider was not specified in the connectionstring.

View 1 Replies

DB/Reporting :: Changing Database While Connection Open?

May 17, 2010

I have a connection string in my app.config:

Code:
connectionString="data source=.sql2008 ;Database=Database1; Integrated Security=FALSE; Persist Security Info=True;" />

How do I change to another database (one of many) without using multiple strings? Can I change while the connection is open?

Code:
Dim myConn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved