Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Sunday, March 25, 2012

ActiveX program control merge replication.

Hi There, i am using msde 2000 sp3 and sql 2000 sp3 as a subscriber
and distributer or publisher.
I created a merge replication programatically so when user click
synchronize it synchronize between msde and server. When i try to run
the program the following message come.
" -2147221504- n[microsoft][odbc sql server driver] [tcp/ip sockets]
sql server does not exist or access denied. [microsoft][odbc sql
server driver] connection open connect().
please give me some information why this problem is coming. I would
like to know what are the dependent file or dll file for merge
replication. i am using merger replicaiton with pull subscriber.
the subscriber can be window 2000, xp etc.
I will be thankful if anyone give me some information for this
problem.
Indra.
From what you describe it sounds like you are having a problem connecting to the publisher from the subscriber, and furthermore it sounds like you are having a name resolution problem.
On your subscriber try to ping the publisher.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Indra" wrote:

> Hi There, i am using msde 2000 sp3 and sql 2000 sp3 as a subscriber
> and distributer or publisher.
> I created a merge replication programatically so when user click
> synchronize it synchronize between msde and server. When i try to run
> the program the following message come.
> " -2147221504- n[microsoft][odbc sql server driver] [tcp/ip sockets]
> sql server does not exist or access denied. [microsoft][odbc sql
> server driver] connection open connect().
> please give me some information why this problem is coming. I would
> like to know what are the dependent file or dll file for merge
> replication. i am using merger replicaiton with pull subscriber.
> the subscriber can be window 2000, xp etc.
> I will be thankful if anyone give me some information for this
> problem.
> Indra.
>

Monday, March 19, 2012

Active Directory Reports

I'm not sure this is an actual reporting services question but has someone else created reports for active directory in Reporting Services

I want to create a report with users and their respective manager. I have this working in reporting services but I just want the manager name how could I strip out all the other information in the manager field?

SELECT personalTitle, manager, name, employeeid, distinguishedName
FROM 'LDAP://dc=xxx,dc=xxx,dc=xxxt'
WHERE objectClass = 'user' AND objectCategory = 'Person'
ORDER BY name

I get this as the manager name, I just want his name

CN=Smith\, Kurt,OU=Financial,OU=DataControl,OU=Users-Groups,DC=xxx,DC=xxx,DC=xxx

Thank you,

There should an AD property that gives you the name as entered. As a last resort, you can call a custom function to parse the name, e.g.

= Code.MyFunction(Field!name.Value)

|||

Hi thank you, I had tried a function in the bids tool by calculating a new member using this

=Mid(Fields!manager.Value,4,(InStr(Fields!manager.Value,",OU=")-4)) and this works fine on my desk top but when I attemtp to deploy it I get an error

Warning 1 [rsRuntimeErrorInExpression] The Value expression for the field ‘ManagerName’ contains an error: Argument 'Length' must be greater or equal to zero. C:\mydocs\SQL Server Management Studio\Projects\Active Directory\Active Directory\Active Dir Manager Report.rdl 0 0
Managername is my new calculated column

|||Could you prepare and send a sample report that demonstrates the issue? You can hardcode the dataset if you wish, e.g. using SELECT...UNION.|||

Thank you for the response. It was a data issue with the manager, some of my manager names were blank I had to search for them and replace with values prior to using the other functions: in case your interested first I use IIF

I put in the same values as I plan to strip off with the next calculated member

new field LookforNoManager

=IIF(Fields!manager.Value Is Nothing,"CN=Not Available,OU=",Fields!manager.Value)

then I created this new ManagerName

=Mid(Fields!LookForNoManager.Value,4,(InStr(Fields!LookForNoManager.Value,",OU=")-4))

one way around it I guess.

Now after I upload them I can't connect to the either the OLE DB active directory datasource directly or my linkserver ADSI datasource from the webserver? is there any trick to this definition

Here is my connection string for the linkedserver

Provider=ADsDSOObject;Data Source=lifeeai602\devsqlservices

here is my connecting sting when I tried to define the datasource directly to active directory

Provider=ADsDSOObject

Do I need to change something to point to LDAP?

|||Not sure how you connect. If it works in VS.NET but it doesn't on the server it is probably security. What credentials do you specify on the data source and what provider do you use?|||

Hi,

I use windows integrated security in the development tool and I set that up on the server to access the datasource as well, here is part of the error from the RS logfile

aspnet_wp!processing!5!3/30/2007-14:25:08:: e ERROR: An exception has occurred in data source 'NewDataSource'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'NewDataSource'. > System.Data.OleDb.OleDbException: 'ADsDSOObject' failed with no error message available, result code: DB_E_NOTABLE(0x80040E37).
aspnet_wp!processing!5!3/30/2007-14:25:08:: i INFO: Merge abort handler called for ID=-1. Aborting data sources ...
aspnet_wp!dataextension!5!3/30/2007-14:25:08:: w WARN: CommandWrapper.Cancel not called, connection is not valid
aspnet_wp!processing!5!3/30/2007-14:25:08:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing., ;
Info: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'NewDataSource'. > System.Data.OleDb.OleDbException: 'ADsDSOObject' failed with no error message available, result code: DB_E_NOTABLE(0x80040E37).
End of inner exception stack trace
aspnet_wp!processing!5!3/30/2007-14:25:08:: w WARN: Data source 'NewDataSource': Report processing has been aborted.
aspnet_wp!processing!5!3/30/2007-14:25:08:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing., ;
Info: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'NewDataSource'. > System.Data.OleDb.OleDbException: 'ADsDSOObject' failed with no error message available, result code: DB_E_NOTABLE(0x80040E37).
End of inner exception stack trace

***************************************************************************************

Connection type:

OLE DB

Connection string:Provider=ADsDSOObject;Data Source=lifeeai602\devsqlservices

Windows integrated security

Active Directory Groups Don't Work with Linked Server?

I mapped a login created with an Active Directory Group on server A to a login on server B through a linked server on server A and received a null login error when attempting to connect.

I changed the Active Directory Group login to an individual active directory login and the connection worked fine.

I saw someone post online somewhere that Active Directory Groups don't work with linked server by design--but I wanted to get confirmation on this. Can anyone confirm this, particularly someone from Microsoft?

This might be the dreaded "Double-hop" scenario. There's a great rundown by a Microsoft Protocols Engineer here:

http://blogs.msdn.com/sql_protocols/archive/2006/08/10/694657.aspx

That will get you started on learning why this is happening.

Active Directory Groups Don't Work with Linked Server?

I mapped a login created with an Active Directory Group on server A to a login on server B through a linked server on server A and received a null login error when attempting to connect.

I changed the Active Directory Group login to an individual active directory login and the connection worked fine.

I saw someone post online somewhere that Active Directory Groups don't work with linked server by design--but I wanted to get confirmation on this. Can anyone confirm this, particularly someone from Microsoft?

This might be the dreaded "Double-hop" scenario. There's a great rundown by a Microsoft Protocols Engineer here:

http://blogs.msdn.com/sql_protocols/archive/2006/08/10/694657.aspx

That will get you started on learning why this is happening.

Sunday, March 11, 2012

Activating the Queue

Hi,

I have created Queue with the following syntax. But it is not getting activated itself. What I have to do to get it activated itself, and what could be the frequency by default.

CREATE QUEUE NewCustomerQueue
WITH ACTIVATION
(PROCEDURE_NAME = prProcessNewCustomers,
STATUS = ON,
MAX_QUEUE_READERS = 1,
EXECUTE AS SELF)
GO

If I execute the prProcessNewCustomers procedure manually it is showing that the Queue has been activated. What change I have to make in the syntax to get it activated itself.

Actually I have two scenarios in my requirement,

1. One Queue processing immediately when it receives data (Order Processing)

2. Another Queue, Process when the server is idle i.e., off-peak time (for mailing)

What syntax I have to use for these.

Please help.

Thanks in advance

Babu

Activation can be turned on and off using ALTER QUEUE

ALTER QUEUE NewCustomerQueue WITH ACTIVATION (STATUS = ON|OFF);

So in your first scenario you can keep activation on always. In your second scenario, you can keep it off by default and turn it on whenever desired.

Activation launches the specified stored procedure in the background upon receipt of incoming messages. If the procedure cannot keep with the rate of incoming messages, it can launch concurrent instances of the stored procedure (you need to set max_queue_readers > 1 for that).

Hope that helps,

Rushi

|||

Hi Rushi,

Thanks for your reply.

I have created the Queue with the ACTIVATION (STATUS = ON) only.

Currently I'm trying with a typical example what I got from some books. When a new customer is added, the trigger in the Customer table will "BEGIN DIALOG CONVERSATION" and send a message. I think when a message is sent, the Queue should get activated. It is not happening in this case. What could be the reason.

Please help.

Regards

Babu

|||

Hi Babu:

First make sure the trigger runs by checking in query analyser. Check the sql profiler to see whats the errror your getting.

Pramod

|||

Do you see the message in the target queue?

select * from [target queue]

(where [target queue] is the name of your target queue)

Rushi

|||

Hi Rushi, Pramod,

Thank you both for the responses.

The problem was occured because the 'Idle CPU Condition' was not defined.

I'll come back with new doubts . Thank you once again.

Regards

Babu

Tuesday, March 6, 2012

Acess and VB

Hi all,
If I have a form created on MS Access, could I copy it exactly the same form to VB form, so that users could exactly perform operations the same on Access form?
thanks again for caring
Any suggestion and comments would be Acceptable

Suggestion: Go to an MS Access forum.

Acess 2003 connection problem to SQL Server

I have a small group who uses Access 2003 to connect to SQL Server. The
users run XP pro and Access 2003. A common DSN is created on each user’s
box. They are connecting to a box with Windows 2000 Standard Svc Pack 4 &
SQL Server 2000 Standard Svc Pack 3a. They are linking to the SQL Server
tables. We are using windows authentication.
The two users are not able to access SQL Server at the same time. The error
message they are receiving is:
Microsoft Office Access
Could not execute query; could not find liked table.
[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name
‘dbo.MAIN. (#208)
Interesting though is that if the user drops the e linked table and try to
relink it the objects that appear are from the Master database.
I verified the Group the users belong to have the correct default database
set.
I am at a loss and any help or hints to get me going in the right direction
would be appreciated.
It will work better for you if you ditched the DSNs and wrote VBA/DAO
code to relink the tables. You can supply ODBC connection string
information directly when the application loads, and delete the
TableDef objects when the application closes. You supply a source
table name, and the name of the link in the FE separately. This way
you pick up any schema changes to the underlying tables, which
invalidates old links. You can get the correct connection string from
http://able-consulting.com/ADO_Conn.htm. I recommend using DAO for
this instead of ADOX because there have been problems in the past with
linked tables coming in read-only.
--Mary
On Thu, 12 Aug 2004 09:21:02 -0700, "T Man"
<TMan@.discussions.microsoft.com> wrote:

>I have a small group who uses Access 2003 to connect to SQL Server. The
>users run XP pro and Access 2003. A common DSN is created on each users
>box. They are connecting to a box with Windows 2000 Standard Svc Pack 4 &
>SQL Server 2000 Standard Svc Pack 3a. They are linking to the SQL Server
>tables. We are using windows authentication.
>The two users are not able to access SQL Server at the same time. The error
>message they are receiving is:
>Microsoft Office Access
>Could not execute query; could not find liked table.
>[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name
>dbo.MAIN. (#208)
>
>Interesting though is that if the user drops the e linked table and try to
>relink it the objects that appear are from the Master database.
>I verified the Group the users belong to have the correct default database
>set.
>I am at a loss and any help or hints to get me going in the right direction
>would be appreciated.
|||Mary,
I am confused regarding the stance on the usage of DAO... In an email to
another user it appears you do not favor the use of DAO...
(At this point in time, DAO 3.6 is truly ancient...), however, in this case
it appears preferred.
Is it OK for linking, but not OK to perform updates ? Just want to know the
difference.
Thanks
"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
news:s0oph0tv4tkue147148v4qccketajvdetj@.4ax.com... [vbcol=seagreen]
> It will work better for you if you ditched the DSNs and wrote VBA/DAO
> code to relink the tables. You can supply ODBC connection string
> information directly when the application loads, and delete the
> TableDef objects when the application closes. You supply a source
> table name, and the name of the link in the FE separately. This way
> you pick up any schema changes to the underlying tables, which
> invalidates old links. You can get the correct connection string from
> http://able-consulting.com/ADO_Conn.htm. I recommend using DAO for
> this instead of ADOX because there have been problems in the past with
> linked tables coming in read-only.
> --Mary
> On Thu, 12 Aug 2004 09:21:02 -0700, "T Man"
> <TMan@.discussions.microsoft.com> wrote:
&[vbcol=seagreen]
error[vbcol=seagreen]
to[vbcol=seagreen]
database[vbcol=seagreen]
direction
>

Saturday, February 25, 2012

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.
You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Accidentally created new LDF, now get error with old LDF

Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
newbie and here is what I did.
1. Detach MDF through right-click options
2. Move LDF to new drive
3. Attach MDF through right-click options
4. Path would not change for original LDF location and I hit OK by
accident (not sure how) but I did, and it created a new LDF in the
original location.
5. Detach MDF again
6. Attach MDF again
7. Manually typed path of moved LDF (the one I wanted to begin with)
and did not click verify (that always changed the location back to the
original). Just clicked OK and it took the path.
8. ERROR 5173 Cannot associate files with different databases
Any help would be greatly appreciated.
Regards,
Gary
When you attached the db the first time it created a new log file and
adjusted the metadata to account for it. At that point the original log
file was no longer valid. So you should detach it and move the new log file
to the other location and attach that one.
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134830448.181128.92340@.z14g2000cwz.googlegro ups.com...
> Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
> newbie and here is what I did.
> 1. Detach MDF through right-click options
> 2. Move LDF to new drive
> 3. Attach MDF through right-click options
> 4. Path would not change for original LDF location and I hit OK by
> accident (not sure how) but I did, and it created a new LDF in the
> original location.
> 5. Detach MDF again
> 6. Attach MDF again
> 7. Manually typed path of moved LDF (the one I wanted to begin with)
> and did not click verify (that always changed the location back to the
> original). Just clicked OK and it took the path.
> 8. ERROR 5173 Cannot associate files with different databases
> Any help would be greatly appreciated.
> Regards,
> Gary
>
|||Thanks for the reply. Do I not need the original LDF file then? Have I
lost anything?
|||Hopefully not<g>. When you detach the db it should commit or rollback all
transactions that haven't already been attended to. Before you do anything
like detach a db it is always a good idea to do a full backup first in case
anything happens and you need to get back to where you were. But in this
case you should be fine as long as the attach works with no errors.
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134832357.374087.105070@.g44g2000cwa.googlegr oups.com...
> Thanks for the reply. Do I not need the original LDF file then? Have I
> lost anything?
>

Accidentally created new LDF, now get error with old LDF

Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
newbie and here is what I did.
1. Detach MDF through right-click options
2. Move LDF to new drive
3. Attach MDF through right-click options
4. Path would not change for original LDF location and I hit OK by
accident (not sure how) but I did, and it created a new LDF in the
original location.
5. Detach MDF again
6. Attach MDF again
7. Manually typed path of moved LDF (the one I wanted to begin with)
and did not click verify (that always changed the location back to the
original). Just clicked OK and it took the path.
8. ERROR 5173 Cannot associate files with different databases
Any help would be greatly appreciated.
Regards,
GaryWhen you attached the db the first time it created a new log file and
adjusted the metadata to account for it. At that point the original log
file was no longer valid. So you should detach it and move the new log file
to the other location and attach that one.
--
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134830448.181128.92340@.z14g2000cwz.googlegroups.com...
> Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
> newbie and here is what I did.
> 1. Detach MDF through right-click options
> 2. Move LDF to new drive
> 3. Attach MDF through right-click options
> 4. Path would not change for original LDF location and I hit OK by
> accident (not sure how) but I did, and it created a new LDF in the
> original location.
> 5. Detach MDF again
> 6. Attach MDF again
> 7. Manually typed path of moved LDF (the one I wanted to begin with)
> and did not click verify (that always changed the location back to the
> original). Just clicked OK and it took the path.
> 8. ERROR 5173 Cannot associate files with different databases
> Any help would be greatly appreciated.
> Regards,
> Gary
>|||Thanks for the reply. Do I not need the original LDF file then? Have I
lost anything?|||Hopefully not<g>. When you detach the db it should commit or rollback all
transactions that haven't already been attended to. Before you do anything
like detach a db it is always a good idea to do a full backup first in case
anything happens and you need to get back to where you were. But in this
case you should be fine as long as the attach works with no errors.
--
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134832357.374087.105070@.g44g2000cwa.googlegroups.com...
> Thanks for the reply. Do I not need the original LDF file then? Have I
> lost anything?
>

Accidentally created new LDF, now get error with old LDF

Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
newbie and here is what I did.
1. Detach MDF through right-click options
2. Move LDF to new drive
3. Attach MDF through right-click options
4. Path would not change for original LDF location and I hit OK by
accident (not sure how) but I did, and it created a new LDF in the
original location.
5. Detach MDF again
6. Attach MDF again
7. Manually typed path of moved LDF (the one I wanted to begin with)
and did not click verify (that always changed the location back to the
original). Just clicked OK and it took the path.
8. ERROR 5173 Cannot associate files with different databases
Any help would be greatly appreciated.
Regards,
GaryWhen you attached the db the first time it created a new log file and
adjusted the metadata to account for it. At that point the original log
file was no longer valid. So you should detach it and move the new log file
to the other location and attach that one.
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134830448.181128.92340@.z14g2000cwz.googlegroups.com...
> Greetings all. I wanted to separate the MDF and LDF files. I am an SQL
> newbie and here is what I did.
> 1. Detach MDF through right-click options
> 2. Move LDF to new drive
> 3. Attach MDF through right-click options
> 4. Path would not change for original LDF location and I hit OK by
> accident (not sure how) but I did, and it created a new LDF in the
> original location.
> 5. Detach MDF again
> 6. Attach MDF again
> 7. Manually typed path of moved LDF (the one I wanted to begin with)
> and did not click verify (that always changed the location back to the
> original). Just clicked OK and it took the path.
> 8. ERROR 5173 Cannot associate files with different databases
> Any help would be greatly appreciated.
> Regards,
> Gary
>|||Thanks for the reply. Do I not need the original LDF file then? Have I
lost anything?|||Hopefully not<g>. When you detach the db it should commit or rollback all
transactions that haven't already been attended to. Before you do anything
like detach a db it is always a good idea to do a full backup first in case
anything happens and you need to get back to where you were. But in this
case you should be fine as long as the attach works with no errors.
Andrew J. Kelly SQL MVP
"Dreamer" <spencermountains@.yahoo.com> wrote in message
news:1134832357.374087.105070@.g44g2000cwa.googlegroups.com...
> Thanks for the reply. Do I not need the original LDF file then? Have I
> lost anything?
>

Friday, February 24, 2012

access-SQL ODBC link

> Hello,
> I am using trusted windows user connection to SQL
server.
> I created an ODBC link from Access to SQL server. I am
> able to modify data in tables through SQL Enterprise
> Manager however I am not able to modify them in Access.
> What is missing?You need to create a primary key or unique index on any SQLS tables
you want to modify from Access.
--mary
On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>server.|||Why do I have to do that? And if my primary key is based
on many columns will that cuse any problem?
>--Original Message--
>You need to create a primary key or unique index on any
SQLS tables
>you want to modify from Access.
>--mary
>On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
><anonymous@.discussions.microsoft.com> wrote:
>
Access.[vbcol=seagreen]
>.
>|||Why? because it won't work if you don't. Access can't locate the row
on the server, update it, and guarantee data integrity if the table
doesn't have a PK. If your PK is based on too many columns, then you
should consider a surrogate PK. A good starting point would be
"Database Design for Mere Mortals: A Hands-On Guide to Relational
Database Design" by Mike Hernandez.
--Mary
On Sun, 18 Apr 2004 17:58:46 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Why do I have to do that? And if my primary key is based
>on many columns will that cuse any problem?
>SQLS tables
>Access.

access-SQL ODBC link

> Hello,
> I am using trusted windows user connection to SQL
server.
> I created an ODBC link from Access to SQL server. I am
> able to modify data in tables through SQL Enterprise
> Manager however I am not able to modify them in Access.
> What is missing?
You need to create a primary key or unique index on any SQLS tables
you want to modify from Access.
--mary
On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>server.
|||Why do I have to do that? And if my primary key is based
on many columns will that cuse any problem?
>--Original Message--
>You need to create a primary key or unique index on any
SQLS tables[vbcol=seagreen]
>you want to modify from Access.
>--mary
>On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
><anonymous@.discussions.microsoft.com> wrote:
Access.
>.
>
|||Why? because it won't work if you don't. Access can't locate the row
on the server, update it, and guarantee data integrity if the table
doesn't have a PK. If your PK is based on too many columns, then you
should consider a surrogate PK. A good starting point would be
"Database Design for Mere Mortals: A Hands-On Guide to Relational
Database Design" by Mike Hernandez.
--Mary
On Sun, 18 Apr 2004 17:58:46 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Why do I have to do that? And if my primary key is based
>on many columns will that cuse any problem?
>SQLS tables
>Access.

Sunday, February 19, 2012

Accessing System.Data.SqlServerCe Namespace

Hi there,

Background: I've created an application to run on windows mobile 5.0 devices. It replicates to a publication on a server. To do this it goes through ASP.net. This creates the database on the Mobile Devices.

Issue: Problem is the initial download of the database is taking 2hours plus to replicate (create) for the first time. So I'm trying to create the .sdf file on the server, zip it, and send it across to the handheld. All subsequent replications take about 5 minutes.

Question: Does anyone know how, or have examples for creating a Mobile CE database on the server. I need to create it using ASP.net and go through a pre-existing publication where a hostname used for filtering.

http://msdn2.microsoft.com/en-us/library/ms173009.aspx explains how to create this in SQL Server Management Stuidio. How do you do the same thing over ASP?

Can this be done using SMO? How do you create a SQLServerCompactEdition database using normal .NET Framework? Thanks for your help!!

Is it possible to access System.Data.SqlServerCe namespace without using the .NET Compact Framework?

So if I wanted to access the assembly in a VB.NET Windows App inside the .NET Framework, is this possible?

|||

Yes, SQL CE 3.1 allows you to do that. There’s a special version of SQL CE provider for desktop framework.

|||You can run code like in this sample (http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlcereplication.synchronize.aspx

on your web server. create the file to the local file system and zip it. Then give the device the URL to the .zip file and your .NET Compact Framework app can the download the .zip file using HttpWebRequest class and unzip.

|||

So the problem i was having was in using an assembly that came with the compact framework. The System.Data.SqlServerCE.dll file is located in at least two places on my machine. One in the CE and one in the Common folder...both have the same name and version number.

I changed the reference from pointing at the CE version to the normal version and it cleared up the problem. Thanks for the responses, I'm still not sure what the differences in the assemblies are.

Accessing Stored Procedure parameters through XSD

Hi All,

I have created a stored procedure (in SQL Server 2005 - Developer) with input and output parameters. Please somebody let me know how I can call this store procedure from code behind using TableAdapter i.e. through XSD.

Thanks,

Long Live Microsoft ;)

You can start from here:Working with a Typed DataSet, and this tutorial should help:Working with Data in ASP.NET 2.0 :: Sorting Custom Paged Data. However if you just want to call the stored procedure from .net application, it should be?much easier to use SqlCommand/SqlDataAdapter.|||

Thanks for the response,

I have created a store procedure

CREATEPROCEDURE [GetUserDetails]

(

@.paramUserID INT ,

@.paramName VARCHAR(50) OUTPUT,

@.paramEmail VARCHAR(150) OUTPUT,

@.paramDOB DATETIME OUTPUT

…

…

--here more parameters will come

)

AS

BEGIN

SELECT

@.paramName = [Name]

,@.paramEmail =Email

,@.paramDOB = [DOB]

FROM

[Users]

WHERE

[UserID] = @.paramUserID

--more sql script will be here for additional parameters

END

I know we can easily call the strored procedure by using sqlcommand and adding sqlparameters etc.

But I have create the Dataset(xsd) in my application and I need to channel all my data operations through this.

I'v create a tableadapter for 'user' table and I need to add a query using existing stored proc 'GetUserDetails'. This procedure will expand cause I need to add another functionalities to it.

Please could you explaing how can I do this.

|||Well it's not a short explanation,?and?I?think?it's?better?to?follow?some?tutorial:

Working with Data in ASP.NET 2.0 :: Creating a Data Access Layer|||

Thanks Iori_Jay

Finally Igot the solution, and its working.

Myproblem was:

Executing stored procedure with inputand output parameters through XSD.

Stored Procedure

Posted earlier

User.xsd

TableAdapter: UserDetailsTableAdapter

Query: GetUserDetails(@.paramUserID,@.paramName, @.paramEmail, @.paramDOB)

Code to access outputparameter values

UsersTableAdapters.UserDetailsTableAdapterssobjGetUser =new UsersTableAdapters.UserDetailsTableAdapter();

String strName ="",

strEmail ="";

DateTime? dtDOB =DateTime.Now;

objGetUser.GetUserDetails(3/*userid*/, ref strName,refstrEmail,ref dtDOB);

Response.Write("<h3>UserDetails</h3>");

Response.Write("<strong>Name:</strong> " +strName);

Response.Write("<br/> <strong>Email:</strong>" + strEmail);

Response.Write("<br/><strong>DOB:</strong> " + dtDOB.ToString());


Although "System.String" and "string" are reference typesit showed error when "string" is used, so I used "String" instead of "string".

Added "?" to avail the reference property of value type "Datetime".

Thursday, February 16, 2012

Accessing SQL Server remotely

Dear All,

I have created a database on my SQL server, I want to access my database through C# .NET project . By just installing the software on the client side I would be able to access my SQL server remotely.

On internet can i Do that?

Plz let me know any solution for this.

Regards,

Anil Dhiman

DId I understand you right that you want to connect through the internet to your SQL Server ? Then you have to redirect/forward port 1433 of the connected internet gateway to the SQL Server that you have within your infrastructure.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Hi Anil,

Also keep in mind that your server is a named instance, then it may not necessarily be using port 1433. I this case, you may need to make sure that SQL Browser is started and UDP port 1434 is opened on the firewall in addition to the instance port. These KB articles may be of some assistance for configuring the firewall:

http://support.microsoft.com/kb/287932/en-us
http://support.microsoft.com/kb/841249/en-us

Alternatively, the client's connection string can explicitly contain the connection port in which case, you don't need SQL Browser.

Il-Sung./

Monday, February 13, 2012

Accessing SQL Database created in Visual Studio

I created an SQL database in Visual Studio 2005 Express Edition and would like to edit it in SQL Server Management Studio Express. The only databases listed in the Object Explorer of SQL Server MSE are the system databases (ones that are part of the SQL Server MSE).

If I dig through the directories, I can locate my database under the Visual Studio directory, but I am unable to open it. I get an error message stating, "There is no editor available for [my database]... Make sure the application for the file type (.mdf) is installed."

I'm sure that this is a ridiculously simple rookie mistake that I'm committing somehow, but I'm stumped. Any idea what I'm doing wrong?

What you need to do is "attach" your database in your management studio. This is supprisingly a goofy process, being that this is our newest implementation of a manager for SQL Express, here's some help to get you started.

http://msdn2.microsoft.com/en-us/library/ms190209.aspx

|||

I tried it, and I think that it should have worked, but it didn't. I got a long string of error messages. It's probably just another bug that Microsoft will some day issue a patch for. When I attempted to add my review of the tip to the msdn website my computer locked up. That was kind of a metaphor for the entire experience. I've learned my lesson. Don't make databases in Visual Studio - do it in SQL Studio or MySQL.

|||

I've never had an issue with the Management Studio, or SQL Express databases, I'm not sure what your experiencing, but they arent as unreliable as your making them out to be.

Sorry you couldnt get it fixed.

Accessing Shared Data Source in VS.net

How can i get the shared data sources i created in the report manager to be available in VS.net to be able to assign to a report. I want to be able to create the shared data source first in Report manager and then be able to assign it a report in VS.Net

Thanks.

You need to find where it stores the .rds file. Then in Visual Studio, you could add the existing data source. I'm not sure where it stores the file though.

|||

Wouldnt it be stored on the Report Services server?

|||

Yes, but I mean where would the .rds file be stored in windows? Try creating a new data source from report manager then searching for the name of the data source in windows. Once you find where it typically stores the files, you can just go to that path and use the existing data source to add it to Visual Studio.

I would think anyway....

|||

If you created a shared datasource in the report manager, you can script it using RS Build (http://www.codeplex.com/RSBuild/) or RS Scriptor (http://www.sqldbatips.com/showarticle.asp?ID=62).

Alternatively, you can take the low-level approach and read the appropriate table in the ReportServer database <g>.

The point of these scripts is supposed to be to publish to a different server, etc, and as backup -- not specifically for creating a VS definition file, but it will give you what you need to create an .rds file, nonetheless, because that's just an XML file with the same contents as the properties that the scripting tools are extracting out.

Either way, you will almost definitely need to supply the credential information again.

>L<