|
Hello,
I connected two computers in LAN 1st having IP 192.168.1.1 and 2nd having IP 192.168.1.2 and i am having sql server management studio express 2005 installed on 1st computer now when i run exe from 192.168.1.2 it throughs an error like.
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
where as it runs perfetly on 1st computer.
my conection string is
Public DBConn As ADODB.Connection
DBConn.ConnectionString = "Provider=MSDATASHAPE; Data Provider=SQLOLEDB.1;Data Source=TOSHIBA\SQLEXPRESS; Initial Catalog=" & App.Path & "\AVON_AIR_Data.mdf; User ID=sa; Password=; Integrated Security=SSPI; Persist Security Info=False;"
DBConn.Open DBConn.ConnectionString
Please suggest
Thank you.
|
|
|
|
|
|
For remote connections, the Initial Catalog attribute must specify the database name alone, you cannot attach a local database. And the other problem is, you can either specify Integrated Security or User ID/Password , but not both.
|
|
|
|
|
|
Hi Guys,
My data source is FoxPro for Unix using ODBC connection i would like to bring it to sql 2005 by SSIS 2005.
Can any one explain how i could use Dynamic SQL using SSIS Datareader Like for instance
"SELECT * FROM " @[User::TableName] expression???
Please explain the Steps to follow.
Thank you
|
|
|
|
|
Member 8082021 wrote: Can any one explain how i could use Dynamic SQL using SSIS Datareader Like for
instance
Oh this is a fun one; you will need a variable and build the syntax of your query in an expression. Then in the 'data flow', 'source editor' change, 'data access mode' to 'SQL Command from variable. It can be done, just take a little bit of creativity.
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
Thank you so much for your help.
I am having an issue could you please give me a more detailed step in solving this problem.
I have to sort this problem now.
Please advice
KB
|
|
|
|
|
I want to see whether the column is created with the option, 'GENERATED ALWAYS AS IDENTITY', to make use of that in my application whether to create the record including the value for that column or not.
Can anyone please help me in getting this attribute/property from any syscolumns information from DB2 database?
|
|
|
|
|
Hi!
I've to Update only the Last record(row) in MYSQL table. How to do this?
|
|
|
|
|
How are you determining what is the "last" record? By Date? ID Number?
|
|
|
|
|
|
I have a table in Sql Server structured something like this:
RowId OrderId OldOrderId Type Example Data
8787 1 NULL I The first order in sequence 1
9837 2 1 U The second order in sequence 1
10838 3 2 U The third order in sequence 1
11873 4 3 U The fourth order in sequence 1
12554 5 NULL I The first order in sequence 2
14113 6 5 U The second order in sequence 2
15003 7 6 U The third order in sequence 2
18343 8 7 U The fourth order in sequence 2
What I am trying to do is find the last record in each sequence using only the columns I have in the table. I cannot add anything to group by as I am not in control of the data. Has anyone got any ideas? I have done something like this before but I cannot seem to put my hands on it at the moment.
Thanks in advance
|
|
|
|
|
Does the solution have to be SQL Based?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Yes, I need it to be SQL based. I think I'm nearly there, think possibly being the operative word
|
|
|
|
|
I hope this will help you
select max(mt.rowid) as RowId,
(select top 1 mt1.Data from mytable mt1 where rowid = max(mt.rowid)) as Data
from mytable mt
group by substring(mt.data, charindex('order',mt.data),len(mt.data))
order by max(mt.rowid) desc
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Thanks for the reply, unfortunately there is nothing to group by. I need to find the last in sequence using only the OrderId and OldOrderId values.
|
|
|
|
|
Based on that data of table which you have gave in your first post then query will work. Otherwise post data structure how they are in table.
by this query
select max(mt.OldOrderID) as OldOrderID,
(select top 1 mt1.Data from mytable mt1 where mt1.OldOrderID = max(mt.OldOrderID)) as Data
from mytable mt
group by substring(mt.data, charindex('order',mt.data),len(mt.data))
order by max(mt.OldOrderID) desc
you will get this result
OldOrderID Example Data<br />
7 The fourth order in sequence 2<br />
3 The fourth order in sequence 1
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Sorry, the data in ExampleData column could be anything, just purely an example to indicate that the record has additional data.
|
|
|
|
|
Ok, how about to explain you more your case, which result you want to get from your table data?
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
The resultset you had in your original post is the resultset I am looking for, however, like I said in my original post, there is nothing to group by. What I probably should have posted is given the following dataset, how do I find the last RowID in the sequence and missed off the ExampleData column.
|
|
|
|
|
For anyone who is interested, here is my solution:
SELECT
Orders.ExampleData
FROM
OrderSeq AS Orders
LEFT JOIN
OrderSeq AS Updates ON (Orders.OrderId = Updates.OldOrderId) AND (Updates.[Type] = 'U')
where
(Updates.RowId IS NULL)
I knew it was easy, just couldn't get my head around it this morning.
Thanks to everyone who replied.
|
|
|
|
|
Hello people of CP,
I have a problem and would like you to help me fix it.
The problem is that right after I call a stored procedure calling the method stated in the title, the execution of the program is interrupted without any warning or prompt whatsoever.
The code block is this:
public virtual object Execute()
{ return this.command.ExecuteNonQuery();
}
I know the command executes because the state in the DataBase is changed. But right after the return this.command.ExecuteNonQuery(); line, the program just stops. It doesn't throw an exception, it doesn't even go to the last bracket of the method, the program just exits.
So, any idea what this might be?
Thanks a lot!
Edit:
Here's a clearer example:
private void SetSystemEnviroment()
{
try
{
using (OracleCommand command = this.con.CreateCommand())
{
command.CommandText = "SetSystemEnviroment";
command.CommandType = CommandType.StoredProcedure;
command.ExecuteNonQuery();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
}
Again, after the command.ExecuteNonQuery(); line, it just stops the execution of the program, no warnings, no exceptions, nothing.
modified on Monday, July 25, 2011 6:23 PM
|
|
|
|
|
Can you post the SetSystemEnviroment Stored Procedure code?
|
|
|
|
|
I miss the Command.Connection.Open() before you executeNonQuery()
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hello,
I would like to show data as a single row instead of multiple rows.
For example, a certain user has two status associated, like maybe "Pending Approval" and "Waiting Email Verfication". Instead of showing these statuses on two different rows, I would like to show as one row.
Currently,
John Smith Pending Approval
John Smith Waiting Email Verfication
Should be
John Smith Pending Approval, Waiting Email Verfication
There could such multiple states for this user, but all show in one row.
Thanks so much for your time!
|
|
|
|