Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts

Saturday, February 25, 2012

Accomodating Dummy Data?

Hello,

I am working with a vb6 Windows application that runs on Tablet PC's.
There are about five SQL Server 2000 databases that tie into the
application. SQL Server MSDE runs on the tablets, and currently there
is only one instance running. There are efforts underway to upgrade the
application to a .NET SmartClient.

One enhancement that needs to be made to the current application will
be to provide a 'training mode' in the application for the users. The
user will use the same application, but will work with 'dummy' data
instead of live data when in training mode.

So far as I can tell, the easiest way to accomodate this would be to
have a second instance of MSDE with 'copies' of all the databases
running, but with the 'dummy' data contained in the databases copies.
The application would have some mechanism for switching to 'training
mode', and maybe by some change of a connection string, the dummy data
would be presented in the application.

So aside from accomodating a 'training mode' feature in the
application, the application would remain the same, and the database
schema for the databases would remain the same. Only the data would
change for 'training mode'.

I'm looking for some ideas on how to approach this. This application is
used by five thousand field agents, and so we can't support this
implementation on a case by case basis. So my thought is that the
solution needs to have 'few moving parts'. If we can do this and get
away from having two instances of MSDE, that would be great. I have not
tried to set up identical databases in different directories on the
same instance (I figure that would cause a problem in a system table or
two someplace, but maybe not), but its one thing I want to investigate.

If you have any ideas on this, please share!

Thank you for your help!

CSDunnHave multiple copies of the databases and parameterize the connection
strings used by the application so that you can connect to the Live
data set or the Sample data set.

--
David Portas
SQL Server MVP
--

Thursday, February 16, 2012

Accessing SQL Server with VB6

I need to write a VB app (VB6) to access and manipulate data within a MS SQL Sever 2000 database. I have experience doing this with MS Access. Is it much different/more difficult to do this with SQL Server?
ThanksNothing to it! Just change your connection string to something like...

Driver={SQL Server};Database=MyDB;UID=MyName;PWD=MyPwd;Server= MyServer

Likely won't need to change anything else.|||There are some differences in SQL format, though. The SQL delimiter for dates is the single apostrophe ('); Access uses the hash mark "#"

Also, if you've been using SQL functions within any of your queries, you may need to chenge them to T-SQL equivalents.|||True. As well, Access 97 (or rather Jet 3.5) used the asterisk (*) as its wildcard character. That changed to the percent sign (%) in Jet 4.0.|||Hey guys,

Thanks for the input. I just wanted to make sure that I wasn't signing up for anything too tricky.

Thanks for all the help|||At first it wouldn't seem that way ;)

Monday, February 13, 2012

Accessing server

Hello all,
Can anyone here help me to solve the following problem?
I have developed an application with vb6.0 as front end and ms
sqlserver as back end.
I have already made .exe and now i want to use my application over the
network.
I tried making a shortcut on the client pc from the main pc or server but
iam getting an errror message.
How can I recity this problem?
How can i use my .exe in client machine where the client should acess
the database which is located on the server?
Pls help me.
Thanks in advance
Regards
Jack
Followup Questions:
What's the error message?
It appears that you have installed the VB6 executable and supporting DLL's
on the server, and then, using a UNC Pathname or a Mapped Drive Letter, you
created a Shortcut on the desktop of the client computer.
Is that how it is?
If the user executes the shortcut, then her system will attempt to load all
the components into memory on the local workstation. If there are SQL Server
components required, they will have to be installed locally.
Also, is the SQL Server set up for Domain/Windows Authentication or SQL
Server Authentication or Mixed Mode?
John
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:D47E3EA2-BAF0-4D74-BE44-887149735A59@.microsoft.com...
> Hello all,
> Can anyone here help me to solve the following problem?
> I have developed an application with vb6.0 as front end and ms
> sqlserver as back end.
> I have already made .exe and now i want to use my application over the
> network.
> I tried making a shortcut on the client pc from the main pc or server but
> iam getting an errror message.
> How can I recity this problem?
> How can i use my .exe in client machine where the client should acess
> the database which is located on the server?
> Pls help me.
> Thanks in advance
> Regards
> Jack
|||Thanks for the mail.
I think u didnt get what i need.
Its something like this.
My application uses vb6.0 as front end and sql server as backend.
Now i want to install my application on a network that means i want client
computers to access my databse on the server.
Its a simple application nothing complictaed.
Pls help me.
Regards
jack
"John Smith" wrote:

> Followup Questions:
> What's the error message?
> It appears that you have installed the VB6 executable and supporting DLL's
> on the server, and then, using a UNC Pathname or a Mapped Drive Letter, you
> created a Shortcut on the desktop of the client computer.
> Is that how it is?
> If the user executes the shortcut, then her system will attempt to load all
> the components into memory on the local workstation. If there are SQL Server
> components required, they will have to be installed locally.
> Also, is the SQL Server set up for Domain/Windows Authentication or SQL
> Server Authentication or Mixed Mode?
> John
> "Jack" <Jack@.discussions.microsoft.com> wrote in message
> news:D47E3EA2-BAF0-4D74-BE44-887149735A59@.microsoft.com...
>
>
|||Just change the Datasource of connection string to sql server name...
(i think u might using Localhost as datasource now)
recompile it.. copy it to the client computer...

Sunday, February 12, 2012

Accessing publication properties from Visual Basic (VB6)

Hi all,

I have an existing application that checks a few things before it
launches another application. One thing that the application needs to
check is the subscription properties of both the local database and the
remote (LAN) server.

I've stumbled upon some properties but I am trying to fit in the last
ones and I can't seem to find the right code to accomplish this... Can
anyone shine a little light on this please ?

The following code queries the SQL Server (remote) to get (some of) the
properties of the replicated database. What I would like to fit in
after the 'state' are the properties that you can retrieve with the
EnumAllSubscriptions function. However, I can't seem to find the right
object (sample code) to retrieve those (or I'm just overlooking the
obvious)...

Here is (part of) the code I'm using to query the publication on the
remote server :

Dim oMergePublication As SQLDMO.MergePublication2
Dim oSubscription As SQLDMO.MergeSubscription2

Me.lstPublications.Clear
For Each oReplicationDatabase In
objSQLSERVER.Replication.ReplicationDatabases
If oReplicationDatabase.Name = Me.txtSQLServerDatabase.Text
Then
For Each oMergePublication In
oReplicationDatabase.MergePublications
bFoundReplicated = True
Me.lstPublications.AddItem "Database replicated as
'" & oMergePublication.Name & "'"
For Each oSubscription In
oMergePublication.MergeSubscriptions
Me.lstPublications.AddItem " - subscriber
:" & oSubscription.Subscriber
Me.lstPublications.AddItem " - local
DB :" & oSubscription.SubscriptionDB
Me.lstPublications.AddItem " -
state :" & GetReplStatus(oSubscription.Status)
Next
Next
'For Each osubscriber In oReplicationDatabase.
'Next
End If
Next
Set oReplicationDatabase = Nothing
Set oMergePublication = Nothing

After this, I also want to check the local DB (=pulled subscription)
and show some of the properties (from EnumAllSubscriptions). For
example to warn the user about the need to synchronise (last_updated
value)...

Any help appreciated,

Many thanks

GB

--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snapI'm not sure what you're asking - do you mean that you know that
EnumAllScubscriptions will return the information you need, but you
don't know how to manipulate a SQL-DMO QueryResults object? If so, then
you need to iterate over it, and use the GetColumn% methods to return
the data in the format you want - in this case, GetColumnString is
probably the best one to use.

This is a simple VBScript example of using a QueryResults object:

Option Explicit

Dim oSrv, res, c, r

Set oSrv = WScript.CreateObject("SQLDMO.SqlServer2")
oSrv.LoginSecure = True
oSrv.Name = "MyServer"
oSrv.Connect

Set res = oSrv.ExecuteWithResults("select * from sysobjects")

For r = 1 To res.Rows
For c = 1 To res.Columns
If res.ColumnName(c) = "name" Then
WScript.Echo res.GetColumnString(r, c)
End If
Next
Next

If this isn't helpful, you might get a better answer in
microsoft.public.sqlserver.replication.

Simon|||Sort of Simon,

I'm having difficulty to get the returnset from EnumAllSubscriptions in
a workable object. It just returns nothing or won't compile.
In the code I've added, I managed to get the right call for the
EnumAllSubscriptions but I'm not sure on the syntax it requires. Like :

Dim oSubscription as SQLDMO.Subscriber2
Dim oSubscriptionData as SQLDMO.<??>
For each oSubscriptiondata in
oSubscription.EnumAllSubscribers(SQLDMOSubscriptio n_All)

OR do I need to make something like
Dim Result
Dim oSubscription as SQLDMO.Subscriber2
Result = oSubscription.EnumAllSubscribers(SQLDMOSubscriptio n_All)
and then walk that Result for the correct data

Thanks anyway. I'll give this a try in the .repication group.

GB

Simon Hayes bracht volgend ide uit :
> I'm not sure what you're asking - do you mean that you know that
> EnumAllScubscriptions will return the information you need, but you
> don't know how to manipulate a SQL-DMO QueryResults object? If so, then
> you need to iterate over it, and use the GetColumn% methods to return
> the data in the format you want - in this case, GetColumnString is
> probably the best one to use.
> This is a simple VBScript example of using a QueryResults object:
> Option Explicit
> Dim oSrv, res, c, r
> Set oSrv = WScript.CreateObject("SQLDMO.SqlServer2")
> oSrv.LoginSecure = True
> oSrv.Name = "MyServer"
> oSrv.Connect
> Set res = oSrv.ExecuteWithResults("select * from sysobjects")
> For r = 1 To res.Rows
> For c = 1 To res.Columns
> If res.ColumnName(c) = "name" Then
> WScript.Echo res.GetColumnString(r, c)
> End If
> Next
> Next
>
> If this isn't helpful, you might get a better answer in
> microsoft.public.sqlserver.replication.
> Simon

--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snap

Thursday, February 9, 2012

Accessing one database from multiple SQL servers

Apologies if this question has been asked before. I am about to upgrade a multiuser application based on Access97 and VB6 to C# and possibly SQL Server Express.

My customer does not want to use a server based database solution ie a single instance of SQL Server, but prefers to have a common networked dataset which is accessed via user's own individual database engines. This is because of restrictions on the installation of server based apps.

Does this scenario completely rule out the use of SQL Server Express?

Thanks

You can use SQL Server Express installed on each machine (it's pretty lightweight) with no problem, and even set up a replication between them if they need to share data. A better bet might be to use SQL Server Compact Edition, which is "embeddable". See here for more info:

http://www.microsoft.com/sql/editions/compact/default.mspx

Buck

|||Thanks. I 'll take a look at that.