Showing posts with label msde. Show all posts
Showing posts with label msde. Show all posts

Friday, March 30, 2012

newbie question on TableDefs

I am swtiching from access/Jet to msde, and cannot figure out how to
retrieve the tabledefs from msde

This is how I did it with Jet:

Dim T As TableDef, D As Database, dbpath As String
dbpath = Application.CurrentProject.Path & "\data.mdb"
Set D = DBEngine.Workspaces(0).OpenDatabase(dbpath)
Set T = D.TableDefs(symbolName)

What is the equiavlent for msde/mssql?

MANY Thanks in adv."Ernesto" <tsh@.mathematicuslabs.com> wrote in message
news:0vWdnQohvoduenfdRVn-uA@.speakeasy.net...
> I am swtiching from access/Jet to msde, and cannot figure out how to
> retrieve the tabledefs from msde
> This is how I did it with Jet:
> Dim T As TableDef, D As Database, dbpath As String
> dbpath = Application.CurrentProject.Path & "\data.mdb"
> Set D = DBEngine.Workspaces(0).OpenDatabase(dbpath)
> Set T = D.TableDefs(symbolName)
> What is the equiavlent for msde/mssql?
> MANY Thanks in adv.

I'm not sure exactly what information you need, but one or both of these may
be what you're looking for:

-- List of table names in the current database
exec sp_tables @.table_type = '''table'''

-- Structure of an individual table
exec sp_help MyTable

If that's not useful, then you might want to give some more details -
personally, I don't know what a tabledef is in Access. Also, check out the
"System Stored Procedures" and "Metadata Functions" topics in Books Online,
as there are many ways to retrieve different items of metadata. Finally, if
you're interested in using a COM interface, then SQLDMO can retrieve and
manipulate objects in MSSQL.

Simon|||Simon,
Thanks very much for your reply.
TableDefs are simply the design of the tables.
So it seems that sp_Help does this, as you had guessed I needed.

I looked this up in a few places but stilll it is not clear how I should use
it.
e.g.
http://msdn.microsoft.com/library/d...p_help_304w.asp

says that it returns a "result set", but what is a "result set"? same as a
record set?
This shows how uninformed I am. But I have not found the syntax or how to
look at this result set.

Furthermore, the site says that sp_help works only on the current DB. How
can I specify the relevant database?

More of the code I have to work with is:

dbpath = Application.CurrentProject.Path & "\HOG.data.mdb"
'specify the db
Set D = DBEngine.Workspaces(0).OpenDatabase(dbpath) 'set the
db
Set T = D.TableDefs(symbolName) 'get the definition os
the table named symbolName

For i = 0 To T.Fields.Count - 1 ' look thriogh its fields to
see if "tdate" is one of them
If UCase(T.Fields(i).Name) = "TDATE" Then
isTimeSeries = True
...

If you have any further hints, I will be obliged.

E|||Ernesto (tsh@.mathematicuslabs.com) writes:
> says that it returns a "result set", but what is a "result set"? same as a
> record set?

Yes, "result set" is the proper terminology when you are talking databases.
(Just like "records" are called "rows" and "fields" are called "columns".

> This shows how uninformed I am. But I have not found the syntax or how to
> look at this result set.

You just say:

exec sp_help tbl

The "exec" keyword is optional if this is all you say, but if you are
looking at two, you need it at least for the second call to sp_help.

You run this command from Query Analyzer.

> Furthermore, the site says that sp_help works only on the current DB. How
> can I specify the relevant database?

You can say:

exec some_other_db..sp_help tbl

This applies to all system procedures (those that start with sp_).

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||> You run this command from Query Analyzer.
> You can say:
> exec some_other_db..sp_help tbl
Thanks VERY much for following up.

One more thing, With apologies in advance if this is a stupid question:
I was asking about how to do it from VBA, instead of the Query analyzer.
Where/how will the result set be stored so that the code can inspect it.

TX|||Ernesto (tsh@.mathematicuslabs.com) writes:
> One more thing, With apologies in advance if this is a stupid question:
> I was asking about how to do it from VBA, instead of the Query analyzer.
> Where/how will the result set be stored so that the code can inspect it.

I would guess that you could use ADO to access the database and execute
the commands and get them in record sets.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks,
I found out that this is a direct substitute:

Set Rst = New ADODB.Recordset
Rst.Open "SELECT top 1 * FROM " & symbolName, ConnString

For I = 0 To Rst.Fields.Count - 1
If UCase(Rst.Fields(I).Name) = "TDATE" Then
isTimeSeries = True
...

Monday, March 26, 2012

newbie question

I am sorry if this question has been posted before, but a search in this
newsgroup has not solved the problem at hand:
I have installed MSDE on a windows xp pro machine with IIS already running.
Later I set up the MS Web data administrator (WDA)
However, it is impossble to log in via WDA.
As username I have tried "sa", my initials, my windows user name and
computername/windowsusername
As pw I have tried the strong pw that I used when making the installation
and leaving the pw field in blank.
As server I have tried "MSSQLSERVER", "Localhost" and my computer name.
Nothing works.
The funny thing is that MS Web Matrix can access MSDE without any problems
(which means that MSDE has been correctly installed, I suppose)
Any suggestions will be greatly appreciated.
Thanks
TB
Servername is "." or (local) or the Name of Your Computer, try this.
HTH, Jens Smeyer
http://www.sqlserver2005.de
"TB" <tbpostbox-googlegroups@.yahoo.com> schrieb im Newsbeitrag
news:O8PCyWbQFHA.4028@.tk2msftngp13.phx.gbl...
>I am sorry if this question has been posted before, but a search in this
>newsgroup has not solved the problem at hand:
> I have installed MSDE on a windows xp pro machine with IIS already
> running.
> Later I set up the MS Web data administrator (WDA)
> However, it is impossble to log in via WDA.
> As username I have tried "sa", my initials, my windows user name and
> computername/windowsusername
> As pw I have tried the strong pw that I used when making the installation
> and leaving the pw field in blank.
> As server I have tried "MSSQLSERVER", "Localhost" and my computer name.
> Nothing works.
> The funny thing is that MS Web Matrix can access MSDE without any problems
> (which means that MSDE has been correctly installed, I suppose)
> Any suggestions will be greatly appreciated.
> Thanks
> TB
>
|||When I open the SQL Server Service Manager, the server name is seems to be
the same as my computer name.
When I open the the log file created during the MSDE installation, I find
two entries which I don't know whether are relevant:
"Property(C): LogonUser = Trym"
"Property(C): USERNAME = tb"
Trym is my windows user name.
But I still can't seem to log in.
Is it possible to check what credentials MS Web Matrix uses to log in?
Thanks again.
TB
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:OdfcmabQFHA.924@.TK2MSFTNGP14.phx.gbl...
> Servername is "." or (local) or the Name of Your Computer, try this.
> HTH, Jens Smeyer
> --
> http://www.sqlserver2005.de
> --
> "TB" <tbpostbox-googlegroups@.yahoo.com> schrieb im Newsbeitrag
> news:O8PCyWbQFHA.4028@.tk2msftngp13.phx.gbl...
>
|||hi TB,
TB wrote:
> When I open the SQL Server Service Manager, the server name is seems
> to be the same as my computer name.
> When I open the the log file created during the MSDE installation, I
> find two entries which I don't know whether are relevant:
> "Property(C): LogonUser = Trym"
> "Property(C): USERNAME = tb"
> Trym is my windows user name.
> But I still can't seem to log in.
> Is it possible to check what credentials MS Web Matrix uses to log in?
please verify your MSDE instance accepts SQL Server (standard) authenticated
connections verifying the Windows registry is set as following..
(named instance)
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\InstanceName\MSSQLServer
LoginMode=2
(default instance)
HKLM\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer
LoginMode=2
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hey, that worked: I changed loginMode from 1 to 2, and now I can log using
sa as the username via WDA.
However, another thing happened. After changing the above value, I rebooted
and now the SQL Server Service Manager is no longer visible in the system
tray. But the the database is clearly running (as I can log in from WDA).
Any suggestions?
Thanks again
TB
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3ca3suF6e6b6tU1@.individual.net...
> hi TB,
> TB wrote:
> please verify your MSDE instance accepts SQL Server (standard)
> authenticated connections verifying the Windows registry is set as
> following..
> (named instance)
> HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\InstanceName\MSSQLServer
> LoginMode=2
> (default instance)
> HKLM\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer
> LoginMode=2
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi TB,
TB wrote:
> Hey, that worked: I changed loginMode from 1 to 2, and now I can log
> using sa as the username via WDA.
> However, another thing happened. After changing the above value, I
> rebooted and now the SQL Server Service Manager is no longer visible
> in the system tray. But the the database is clearly running (as I can
> log in from WDA). Any suggestions?
>
please verify your autostart folder includes a link to service manager... if
not, please create a link to your service manager adding a final "/n" , like
"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqlmangr.exe" /n
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Done. Everything is OK now. Molto grazie.
TB
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3cacjaF6knavmU1@.individual.net...
> hi TB,
> TB wrote:
> please verify your autostart folder includes a link to service manager...
> if not, please create a link to your service manager adding a final "/n" ,
> like
> "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqlmangr.exe" /n
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
sql

Wednesday, March 21, 2012

Newbie Q: VBA referencing recordset in linked MSDE SQL table

Hello,
I posted the following question a few days ago and then had to focus on a
different emergency so I didn’t have an opportunity to follow up with
additional information requested. Below is a copy of my initial post, an
example of the code, and the error that is triggered. I’m sorry I was too
vague before.
Thanks!!
Andrea
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi! I am brand spankin' new at this and need help! We just upsized an
Access 2002 database to having an MSDE backend. We used Access's wizard.
In general, the forms seem to be working fine. My problem is with the VBA
underneath. The code breaks when it tries to work with recordsets. I get a
runtime error, “Item not found in this collection.” Between the text book I
have and my web searches, I can't seem to figure out how I need to reference
the SQL tables or if there is a reference library that I need to activate to
make this work now. I have a lot of code like this and for the time being I
am not interested in converting it all to ADO. That can come later. I just
need to get this functional for the client.
The error that is triggered is: Runtime Error 3265 “Item not found in this
collection”
Below is a sample of the code. It breaks at the line that reads:
If Me.NewRecord Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Private Sub Form_Current()
Dim rec As Recordset
' If the form is showing a new record, assignes next chronoligical id number
stored
' in system_maint
If Me.NewRecord Then
Set rec = CurrentDb.OpenRecordset("system_maint")
Me.ID = rec("last_id_num") + 1
rec.Edit
rec("last_id_num") = Me.ID
rec.Update
rec.Close
End If
' requeries all look-up combo boxes.
Me.Artist.Requery
Donor_s_Name.Requery
Building.Requery
End Sub
Andrea
Andrea M wrote:

> Hello,
> I posted the following question a few days ago and then had to focus on a
> different emergency so I didn’t have an opportunity to follow up with
> additional information requested. Below is a copy of my initial post, an
> example of the code, and the error that is triggered. I’m sorry I was too
> vague before.
> Thanks!!
> Andrea
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Hi! I am brand spankin' new at this and need help! We just upsized an
> Access 2002 database to having an MSDE backend. We used Access's wizard.
> In general, the forms seem to be working fine. My problem is with the VBA
> underneath. The code breaks when it tries to work with recordsets. I get a
> runtime error, “Item not found in this collection.” Between the text book I
> have and my web searches, I can't seem to figure out how I need to reference
> the SQL tables or if there is a reference library that I need to activate to
> make this work now. I have a lot of code like this and for the time being I
> am not interested in converting it all to ADO. That can come later. I just
> need to get this functional for the client.
> The error that is triggered is: Runtime Error 3265 “Item not found in this
> collection”
> Below is a sample of the code. It breaks at the line that reads:
> If Me.NewRecord Then
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
> Private Sub Form_Current()
> Dim rec As Recordset
> ' If the form is showing a new record, assignes next chronoligical id number
> stored
> ' in system_maint

> If Me.NewRecord Then
> Set rec = CurrentDb.OpenRecordset("system_maint")
and try CurrentProject instead of CurrentDB.
CurrentProject.OpenRecordset will return an ADO recordset object, which
is what "dim rec as Recordset" has made a reference to.
CurrentDB.OpenRecordset returns a DAO Recordset object.

> Me.ID = rec("last_id_num") + 1
also try:
Me!ID = rec("last_id_num") + 1
> rec.Edit
> rec("last_id_num") = Me.ID
and...
rec("last_id_num") = me!ID
This will ensure that you're accessing the ID control on the form,
instead of an ID Property of the Form object that, of course, doesn't exist.

> rec.Update
> rec.Close
> End If
> ' requeries all look-up combo boxes.
> Me.Artist.Requery
> Donor_s_Name.Requery
> Building.Requery
> End Sub
>

Newbie Q. for referencing DAO recordsets with VBA in Access front

Hi! I am brand spankin' new at this and need help! We just upsized an
Access 2002 database to having an MSDE backend. We used Access's wizzard.
In general, the forms seem to be working fine. My problem is with the VBA
underneath. The code breaks when it tries to work with recordsets. I get a
runtime error, "Item not found in this collection." Between the text book I
have and my web searches, I can't seem to figure out how I need to reference
the SQL tables or if there is a reference library that I need to activate to
make this work now. I have a lot of code like this and for the time being I
am not interested in converting it all to ADO. That can come later. I just
need to get this functional for the client.
Any help appreciated!!!
Thanks,
Andrea
YOu sure have to be a more specific to solve solve your problem. When does
the error occur ? Can you send some code and point out what fails. The error
sounds like you are accessing a column which doesnt exists in the returned
recordset. If you are using a view and you designed t with the view
designer, keep in mind that sometimes the columns are renamed to something
like "expr1" and so on. Another possible error could be that you want to
access a provider specific property which you copied from some example but
isnt supported by that provider.
Send in some information and well try to help you.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Andrea M" <AndreaM@.discussions.microsoft.com> schrieb im Newsbeitrag
news:479D59C8-6D7B-4455-BA3B-D52FBE1163FB@.microsoft.com...
> Hi! I am brand spankin' new at this and need help! We just upsized an
> Access 2002 database to having an MSDE backend. We used Access's wizzard.
> In general, the forms seem to be working fine. My problem is with the VBA
> underneath. The code breaks when it tries to work with recordsets. I get
> a
> runtime error, "Item not found in this collection." Between the text book
> I
> have and my web searches, I can't seem to figure out how I need to
> reference
> the SQL tables or if there is a reference library that I need to activate
> to
> make this work now. I have a lot of code like this and for the time being
> I
> am not interested in converting it all to ADO. That can come later. I
> just
> need to get this functional for the client.
> Any help appreciated!!!
> Thanks,
> Andrea

Newbie Q setting up MSDE

Hello. I've installed MSDE (Win2k machine, running asp.net on localhost),
and it says 'Not Connected' when I mouseover the icon in the system tray. I
opened the SQL Server service manager, and there are two empty fields-
Server and Services. Please, what do I put in these fields? Also, what
connection string would I use with MSDE. Thanks a lot
Justin Dutoit
hi Justin,
"Justin Dutoit" <anon@.anon.com> ha scritto nel messaggio
news:%23Gr48BqqEHA.3988@.tk2msftngp13.phx.gbl
> Hello. I've installed MSDE (Win2k machine, running asp.net on
> localhost), and it says 'Not Connected' when I mouseover the icon in
> the system tray. I opened the SQL Server service manager, and there
> are two empty fields- Server and Services. Please, what do I put in
> these fields? Also, what connection string would I use with MSDE.
> Thanks a lot
> Justin Dutoit
please verify, using the services applet (control panel->performance and
maintenance->administrative tools->services [on XP] , control
panel->administrative tools->services [on Win2k]) that your MSDE instance is
currently up and running...
you can then try typing in the service name of your MSDE instance to manage
it...
MSDE installs by default disabling network protocols and this can be an
issue for some ODBC related functions and, sometime, the SQL Server
instances are not enlisted by the Service Manager, as reported in
http://support.microsoft.com/default...b;EN-US;814132
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Friday, March 9, 2012

newbie connection problem

I am just starting with MSDE switching from access2002.
The installation was done on a server pc with:
password="sa",
Authentication Mode = SQL, and
DisableNetworkProtocols=0
On the server, I can connect to it fine, both via my app and the configure
wiz'd in the SYSTEM-DSNs list (off of control panel-Admin tools).
But from another PC on a two computer network, I cannot connect to it.
The configure wiz;d gives a double error:
SQLstate 1000 connaction failed ANd
SQLState 8001 error 17: serber does not exist or connection denied.
Do I need to specify anything other than server's name as the server's ID,
e.g. the hard disk label or...?
Do I need to somehow tell the server to allow a conection from another
PC? If yes, I can't find where that might be done?
I'd really appreciate ANY help on this frustrating problem.
Thanks in advance,
Run the program MSSQL\80\Tools\Binn\SVERNTCN and add TCP/IP (or whatever
matches the client side) to the server communication protocol.
|||Run the program MSSQL\80\Tools\Binn\SVERNTCN and add TCP/IP (or whatever
matches the client side) to the server communication protocol.

Monday, February 20, 2012

newbe to SQL2005 & MSDE

HELP!!
having on trouble installing, just gettting everything connected.
(xp sp2)
First i loaded MSDE, then realized i needed the web admin tool to create the db...but can't get the web admin tool to connnect to anything..
so I took a stab at SQL 2005 Std ed beta....loaded fine, but then realized i need another admin tool to create db so I loaded the xpress manager...again, loads fine, but doesnt'connec to any DB..
why is this so difficult for me....SQL Svr v6 was so much easier with enterprise manager!!!
HELP!!
DonDon, what do you mean by "the web admin tool"? The utility that comes with Visual Studio .NET 2005?
Can you explain what you mean by "but doesn't connect to any DB."? Are you receiving any error messages?