Connection String to Local Database Problem
I just copied a database on the development server which I am not owner of, but I have rights to the database. I copied it to my local server. Now I need to connect to the local database and I don't know how.
Dim MM_cnnName_STRING
MM_cnnName_STRING = "Provider=SQLOLEDB.1;Password=xxx;Persist Security Info=True;User ID=xxx;Initial Catalog=DBName;Data Source=DevComputerName"
The above is what I used to connect to the development server. How can I figure out the string for my local MS SQL Server
Now I have this error once I try to bring up a page that calls the db
Microsoft OLE DB Provider for SQL Server error '80004005'
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
/CourseList.asp, line 9
Similar Messages
-
Powershell use Connection String to query Database and write to Excel
Right now I have a powershell script that uses ODBC to query SQL Server 2008 / 2012 database and write to EXCEL
$excel = New-Object -Com Excel.Application
$excel.Visible = $True
$wb = $Excel.Workbooks.Add()
$ws = $wb.Worksheets.Item(1)
$ws.name = "GUP Download Activity"
$qt = $ws.QueryTables.Add("ODBC;DSN=$DSN;UID=$username;PWD=$password", $ws.Range("A1"), $SQL_Statement)
if ($qt.Refresh()){
$ws.Activate()
$ws.Select()
$excel.Rows.Item(1).HorizontalAlignment = $xlCenter
$excel.Rows.Item(1).VerticalAlignment = $xlTop
$excel.Rows.Item("1:1").Font.Name = "Calibri"
$excel.Rows.Item("1:1").Font.Size = 11
$excel.Rows.Item("1:1").Font.Bold = $true
$filename = "D:\Script\Reports\Status_$a.xlsx"
if (test-path $filename ) { rm $filename }
$wb.SaveAs($filename, $xlOpenXMLWorkbook) #save as an XML Workbook (xslx)
$wb.Saved = $True #flag it as being saved
$wb.Close() #close the document
$Excel.Quit() #and the instance of Excel
$wb = $Null #set all variables that point to Excel objects to null
$ws = $Null #makes sure Excel deflates
$Excel=$Null #let the air out
I would like to use connection string to query the database and write results to EXCEL, i.e.
$SQL_Statement = "SELECT ..."
$conn = New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString = "Server=10.10.10.10;Initial Catalog=mydatabase;User Id=$username;Password=$password;"
$conn.Open()
$cmd = New-Object System.Data.SqlClient.SqlCommand($SQL_Statement,$conn)
do{
try{
$rdr = $cmd.ExecuteReader()
while ($rdr.read()){
$sql_output += ,@($rdr.GetValue(0), $rdr.GetValue(1))
$transactionComplete = $true
catch{
$transactionComplete = $false
}until ($transactionComplete)
$conn.Close()
How would I read the columns and data for $sql_output into an EXCEL worksheet. Where do I find these tutorials?Hi Q.P.Waverly,
If you mean to export the data in $sql_output to excel document, please try to format the output with psobject:
$sql_output=@()
do{
try{
$rdr = $cmd.ExecuteReader()
while ($rdr.read()){
$sql_output+=New-Object PSObject -Property @{data1 = $rdr.GetValue(0);data2 =$rdr.GetValue(1)}
$transactionComplete = $true
catch{
$transactionComplete = $false
}until ($transactionComplete)
$conn.Close()
Then please try to use the cmdlet "Export-Csv" to export the data to excel like:
$sql_output | Export-Csv d:\data.csv
Or you can export to worksheet like:
$excel = New-Object -ComObject Excel.Application
$excel.Visible = $true
$workbook = $excel.Workbooks.Add()
$sheet = $workbook.ActiveSheet
$counter = 0
$sql_output | ForEach-Object {
$counter++
$sheet.cells.Item($counter,1) = $_.data1$sheet.cells.Item($counter,2) = $_.data2}
Refer to:
PowerShell and Excel: Fast, Safe, and Reliable
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang -
Remote Database connection error on local database while running a procedur
Dear Gurus,
I am trying to run a procedure to grant Select Access to all objects of a schema to all schema but getting below error messages:
Error report:
ORA-02019: connection description for remote database not found
This is on local database and all required privileges have been given to run this procedure but I dont understand why this error is being thrown every time. I am able to fetch all the tables directly (i.e. SELECT object_name FROM user_objects where OBJECT_TYPE IN('TABLE','VIEW','MATERIALIZED VIEW') AND STATUS='VALID')
Kindly let me know if you have any solution.
Procedure detail:
declare
sqltxt varchar(250);
cursor course_det is
SELECT object_name FROM user_objects where OBJECT_TYPE IN('TABLE','VIEW','MATERIALIZED VIEW') AND STATUS='VALID';
v_objnm user_objects.object_name%type;
begin
open course_det;
loop
fetch course_det into v_objnm;
exit when course_det%notfound;
sqltxt :='GRANT SELECT ON ' || v_objnm|| ' TO public with grant option';
EXECUTE IMMEDIATE sqltxt ;
end loop;
end;
System detail:
Oracle 11.2.0.3/Linux 5.3
Ragards.
Edited by: 877938 on Mar 20, 2013 12:27 AMHi,
It seems you are fetching records from one database to other. for that you need to create dblink for that.
Create dblink first and then try to fetch records using that dblink.
ORA-02019: connection description for remote database not found
Cause: An attempt was made to connect or log in to a remote database using a connection description that could not be found.
Action: Specify an existing database link. Query the data dictionary to see all existing database links. See your operating system-specific Net8 documentation for valid connection descriptors. -
How get connection string of default database of CreateUserWizard control
hi,
i am creating website in which I add create user wizard control, I want to restrict user to use one email id only for one time,
but after creating and testing,I get that it allow same email id more than one time, for that I search lot and get this on msdn library, they show that to change config file
<configuration>
<connectionStrings>
<add name="MySqlConnection" connectionString="Data
Source=MySqlServer;Initial Catalog=aspnetdb;Integrated
Security=SSPI;" />
</connectionStrings>
<system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MySqlConnection"
applicationName="MyApplication"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
</system.web>
</configuration>
but,I didn't figure out any database in vs2010 that store data of create user wizard, mean i don't know how to access it in from vs2010
site is working fine, it add new user , allow me login, but where the database???
I want connection string of it's
mandar26Hello Mandar26,
The question should be asked on http://forums.asp.net/ Please reopen a new case there for help.
Regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Em grid control 10.2.0.5 add local database problem
Hi,
I can not add local database to gc.
The following error is reported:
Exception caught when retrieving oracle_database metadata - SAXParseException in parsing Response :: Computed columns can be specified only after other columns
when I want to add monitor passwd the following is reported
Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: (description=(address=(host=devstdby.ucstech.eu)(protocol=tcp)(port=1521))(connect_data=(sid=devstdby)(server=dedicated)))
I have emrep db (10.1) with listener on 1521 port
and db which I want to add to gc with listener running on 1522 port
both on the same machine
Both listeners are correctly configured in gc and running, why listener running on port 1522 is not used to connect to second db ?Hello could you check the configuration of both Listeners within OEM?
So look for both listeners in the All Targets tab and select configure.
Check for the values in:
Port Number
listener.ora directory
Oracle Home
Make sure these values are correct.
Regards
Rob
For more Tips and Tricks on OEM GC see: http://oemgc.wordpress.com -
Why does the connection to a local database get lost when the network is disconnected?
I am using TestStand 3.1. I have a database setup on the local drive and I am using the "Log on the Fly" option.
The test takes 48 hours and I want to make sure that it will not stop if the network connection is lost.
If I unplug the network before starting the test, everything is fine. I can plug the network in and out again while the test runs with no issue.
But if the network is connected and I start the test, and then unplug the network the logging on the fly will give an error.
I have narrowed this down to the step "New UUT for Database Logging" in the SequentialModel.seq (process model). If this step is run with the network connection then the rest of the test needs a network connection.
Is there any way to avoid this error? The whole point of the local database was to avoid network issues.
Thank you for your help.
Solved!
Go to Solution.Hi Scott,
The Error Code is:
-2147467259; User-defined error code.
Possible System Error: Unspecified error
The Error Message is:
An error occurred calling 'LogUUTResult' in 'ITSDBLog' of 'TestStand Database Logging'
An error occurred executing a statement.
Statement: UutResult.
Connection failure
Description: Connection failure
Number: -2147467259
NativeError: 0
SQLState: 08S01
Reported by: Microsoft OLE DB Provider for SQL Server
Description: Unspecified error
Number: -2147467259
NativeError: 0
SQLState: 08S01
Reported by: Microsoft OLE DB Provider for SQL Server
Source: TSDBLog
The Location is:
Step 'LogResult' of sequence 'ProcessModelPostResultListEntry' in 'SequentialModel.seq' -
Chnage connection string after moving database
re-configure database after moving
Hi marky101,
I would suggest you elaborate your scenario/environment/issue with more detail, so that the community members will help you in a effecient manner.
If you want to dynamic change the data connection string in your C# application, please take a look at the following article:
Dynamic Connection String:
http://www.codeproject.com/Articles/755380/Dynamic-Connection-String
If you have any concern regarding move a database from one server to another server, please see the article below:
Move a database from one server to another server in SQL Server 2008:
http://blogs.msdn.com/b/sreekarm/archive/2009/09/11/move-a-database-from-one-server-to-another-server-in-sql-server-2008.aspx
Elvis Long
TechNet Community Support -
JDBC Connection Pool to DB2 database - Problem
When trying to create a new JDBC Connection Pool in WebLogic using BEA Type 4 driver
for DB2, I get the following error:
[BEA][DB2 JDBC Driver]A commitment command has been received on a protected conversation.
The commit and rollback commands are not allowed on protected conversations.
DB2 v8.1 Enterprise Edition on Sun Solaris v8
WebLogic 8.1 SP2 on Windows 2000/XP
Please help!Sorry forgot to add the exception, this is the exception,
java.sql.SQLException: RSR0029: Missing Password for Application Authorization
Any idea as when we get this exception? -
DNS / DNS Local Database problem
Dear Forum,
I have a
RV082 10/100 8-Port VPN Router V03 Firmware v4.1.1.01-sp (Dec 6 2011 20:03:18).
When I set the DNS Servers of DHCP to google (8.8.8.8) everything works like a charm.
In order to use the DNS LOCAL I set the DNS Server to the RV082 address.
I then can resolve the local adresses but not normal internet adresses like www.cisco.com.
They time out. I still can ping everything when I know the IP. But it seems the router does not forward the request.
The WAN Interface has as well the Google DNS Server 8.8.8.8 configure.d
Any hints ?
best regards
DirkDear Forum,
I have a
RV082 10/100 8-Port VPN Router V03 Firmware v4.1.1.01-sp (Dec 6 2011 20:03:18).
When I set the DNS Servers of DHCP to google (8.8.8.8) everything works like a charm.
In order to use the DNS LOCAL I set the DNS Server to the RV082 address.
I then can resolve the local adresses but not normal internet adresses like www.cisco.com.
They time out. I still can ping everything when I know the IP. But it seems the router does not forward the request.
The WAN Interface has as well the Google DNS Server 8.8.8.8 configure.d
Any hints ?
best regards
Dirk -
Change local connection string on remote server
Hello,
I have searched every post and tried every connection string there but can't figure out how to connect to my database on my remote server. I am using Visual Developer 2005 Express Edition in C# and uploading it to a Windows server running asp.net 2.0. The domain has not resolved yet.
I am so new to this and have followed many tutorials step by step but none of them address this issue. They just show how to upload it to the server.
Do I need to use the SQL server provided by my host or can the database stay in the App_Data folder?
My local connection string works locally:
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
When I uploaded to my server I changed \SQLEXPRESS to (local) as advised in the forum.
<add name="ConnectionString" connectionString="Data Source=(local);AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
When I debug a page I get the <customErrors mode="Off"/>
error message even thought I have already set it in my remote web.config file which may be causing problems itself:
<configuration>
<appSettings/>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=(local);AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation debug="false" />
<authentication mode="Windows" />
</system.web>
</configuration>
Thanks for any help you can offer. I wish I could find someone to hire to do this part for me or teach me how over the phone. Any suggestions?Is this still an issue?
Thanks!
Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
Can't create connection to local database
I'm trying to create a connection to a local database but I'm having problems.
Currently we use SQL Plus to do work on the local database. With that we don't need to specify a host string we just leave it blank and it connects with no problems. SQL Developer is now requiring a host string, what are we supposed to use?I added this to the tnsnames.ora to try to help
ORCL.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Port = 1521)
(CONNECT_DATA = (SID = ORCL)
You want something simpler, more like this.
ORCL.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
Trying to connect after that I get an error saying
ORA-12541 TNS no listener.
I made sure the listener service is started but I
don't know what else I need to do with the listener.In a command window, type lsnrctl status. It should show what port the listener is running on and what services it is supporting. You should modify your tnsnames.ora to match
Post the output here if you need more guidance.
Message was edited by:
smitjb -
Connecting Oracle9i Forms to my Local Database
I downloaded the Oracle9i Forms successfully and installed it, but I cannot connect to my local database on the same machine. Please Help!
Ah Ha,
I figured it out.
I checked the Apache error log and saw that it was looking
for _mmServerScripts.
The file for my site was to deep in the www directory (to
many sub files). I moved it up so that apache could find the
_mmServerScripts and bingo I am golden.
I hope this helps anyone who runs into a similar problem. -
I am using developer 3.0 on the NT server machine, with oracle 8
I want to connect with my local database which step i need to take.
please help me in detailOn NT using a new tns_alias works. In your tnsnames.ora file create a new entry for a TCP connection :-
host=<ip address of your NT machine>
sid=<e.g. ORCL>
port=1521
Next create a JDBC connection using this tns_alias. Avoid using beq... or 127.0.0.1. -
Trouble connecting Reporting Services to local database
I am experiencing issues trying to configure/connect the Reporting Services in order to change the database to a local database.
Hi Ralph,
According to your description, it seems that you are trying to connect to a local database when create a data source in a Reporting Services report.
If in this scenario, in the Connection Properties dialog box, we can type . or localhost or server_name in the Server name textbox. Then select the database, Windows Authentication or SQL Server Authentication to log on the server. For more details,
please see the following blog:
http://blogs.technet.com/b/microsoft_in_education/archive/2013/01/31/ssrs-101-creating-a-shared-data-source.aspx
If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
PDO Connection to a local 10G DB
Hello together,
i am using Zend IDE for PHP-Development and have the following problem:
$dbh = new PDO('oci:dbname=LOCAL.ABC.XYZ.ORG','scott','tiger');
connects to the local database inside the IDE without a problem.
Running this login.php script over http://.... inside the browser over an Apache 2.x doesn't connect and i get a script time out.
The settings for the php.ini files (Zend IDE and PHP 5.1.2 installation) are the same.
Is there a solution out ?
Thanks for your help.
HansOther than the typo in the previous comment, the Easy Connect syntax
is often an easier way to connect in PDO, ADOdb, or oci8. If the Oracle
client libraries that PHP links with are 10g or 10gR2, you can use the
connect string "[/]hostname[:port][service_name]". For example to
connect to the HR schema on the local XE database in PDO you can use:
<?php
try {
$dbh = new PDO('oci:dbname=localhost/XE', 'HR', 'HRPASSWORD');
catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
exit;
$s = $dbh->prepare("select city from locations");
$s->execute();
while ($r = $s->fetch(PDO::FETCH_ASSOC)) {
echo $r['CITY'] . "<br>";
?>
Maybe you are looking for
-
Bug? WWV_FLOW_FILES: After File upload FLOW_ID = 0
Hi all, I'm working on a DEVenabled -Environment with APEX 3.1.2. Problem While redesigning an Application I have somke strange behaviour on File Upload: The application uses a custom auth scheme. In my application an uploaded file should be moved to
-
So yet another irritating bug in CC 2014, or is it just me? With my Wacom intuos pro, the airbrush pen stylus wheel doesn't function with flow jitter under the transfer brush setting. That is, I can't use the stylus wheel to adjust flow while paint
-
How to create a function/procedure which can take optional parameter?
Hi, I want to create a function or a procedure which can take optional parameters. For example, I want to create fun1() or fun1(param1) like this. Only one function will act differently when different number of parameters are passed to it. Something
-
Old music onto new ipod??
so i lost my ipod about a month ago and now i'm getting another one, and i'm pretty positive that i can't just plug in the old one...so how do i get all my old music onto my new ipod? THANKS <3<br> windows Windows XP Pro
-
Block status not changing to CHANGED
If I change one base table item in a block the block status stays at QUERY. I have to change two or more item for it to change to CHANGED. This happend after I updated forms builder 61 with the 4a patch. It worked fine before the patch upgrade. Is th