|
Well, I'm assuming you're using SQL Server - if you're not using SQL Server its going to be database specific. Here you go:
select [Name] from sysobjects where xtype = 'u' order by name
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
I want to display the tables from a database in SQLSErver..
So what is this[Name] to be given??
what is this Xtype??
|
|
|
|
|
Ok, I haven't used ADO with C++, so if you're having trouble even connecting to a database I can't help ya, sorry.
But if you have the SQL Server Client Tools installed you can copy that string into Query Analyzer and run it. I swear it works
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Thank you very much..
I tried it in the SQLClient..I got the answer..Now I am trying to get the value throught my VC++...
Thank you very much
Sangeetha
|
|
|
|
|
I want to display the tables from a database in SQLSErver..
So what is this[Name] to be given??
what is this Xtype??
|
|
|
|
|
I have a Word document.I want to input this document to a
database.Generally,i will create a table in a database,then input a
column ,then input next column. In order to save my time,now i want to
input the whole Word document by a program.
please tell me some English information about this.Or tell me web
sites.Thank you!
huang chun shen
|
|
|
|
|
How can I restore a Database which is taken by using Backup option in SQL Server into a machine which is running the MSDE.
|
|
|
|
|
vcsekhar wrote:
How can I restore a Database which is taken by using Backup option in SQL Server into a machine which is running the MSDE.
You can do it using the normal restore operations in Enterprise Manager.
|
|
|
|
|
But, there is no Enterprise Manager available with MSDE. Is there any command line tool for doing that?
--vcsekhar
|
|
|
|
|
You could use the T-SQL Command RESTORE DATABASE
Dave.
|
|
|
|
|
|
Did anybody perform such migration: from Personal Oracle8 (WinNT) to Oracle9i (Linux)?
currently I've got only one problem: some packages, that were normally compiled on Oracle8 cannot be compiled on Oracle9i. Error is PLS-00593: default value of parameter "ParamName" in body must match that of spec. But package header and body are wrapped. So I cannot check default values of parameters... Any ideas?...
I see two possible ways to resolve this: try to find migration utility or find UNWRAP utility to unwrap package body and correct param values.
Thanks beforehand,
Serge.
|
|
|
|
|
I have an app which uses DAO.
It works perfectly in most scenarios, except on Win2K when logged in without admin privelleges.
Without admin privelleges the following error is thrown when attempting to open the database:
> ErrorMessage = Unable to initialize DAO/Jet db engine
> ErrorCode = -2147221164
> Scode Code = 340
> Scode Facility = 4
> Scode Severity = 1
Can anybody help shed some light on the cause?
--
The Obliterator
|
|
|
|
|
According to MSDN, errorcode -2147221164 (0x80040154) is "Class not registered". I'd suggest that DAO hasn't been installed correctly.
Michael
|
|
|
|
|
Hmmn... interesting. Thanks, btw how exactly did you determine that error message? I search MS-KB endlessly!
Sadly I've installed the latest MDAC and the error remains.
Clearly I can't install MDAC with normal user privelleges so I logged in as a normal user and installed it using Run As with Admin privelleges.
I have absolutely no idea how to fix this, let's hope it doesn't happen on customers' machines!
--
The Obliterator
|
|
|
|
|
I believe the Jet db engine is not included with the newest MDAC 2.7 (or anything above 2.5).
you have to download it as a separate install.
Blade[DMS]
|
|
|
|
|
Hmmn I assumed DAO calls would now be routed through their new interfaces.
I guess you could be right, I may need to install the Jet engine seperately.
Thanks
--
The Obliterator
|
|
|
|
|
Hi! I'm going to serialize/save an object into a MS SQL Database ... but how?
Hope anybody can help me!!
/Kenneth
|
|
|
|
|
ok I have problems with understanding somethings at times, and even a hard time explaining things. so here goes. i have a database it holds certain info a username, a password, a contact, a Studentname, and a set of rotations 1-9. ok say you have a set of fields you want to update based upon the username you picked on the previous page how would you go about it? The problem I find is that the update updates the first record in the database not the record i was looking at.can anyone help? constructive help only please!!! here is my code so far.....
<%@ Language="VBScript" %>
<%
Student=request.querystring("Student")
dim TitleChoice
Set TitleChoice = Server.CreateObject("ADODB.Recordset")
With TitleChoice
.ActiveConnection = connLoginUserData
.Source = "SELECT * FROM TitleChoice"
.CursorType = 3
.CursorLocation = 2
.LockType = 3
.Open()
End With
%>
<%
Dim strErrorMessage ' String used to display an error message.
Dim rsUser ' References the user recordset.
Dim rsUserLog ' References the user log recordset.
Dim strEmailTo
Dim strEmailFrom
Dim strSubject
Dim strBody
If Len(Request.Form("Submit")) > 0 Then
If Len(Request.Form("StudentName")) > 0 Then
If Len(Request.Form("Email")) > 0 Then
Set rsUser = Server.CreateObject("ADODB.Recordset")
With rsUser
.ActiveConnection = connLoginUserData
.Source = "Select * FROM tblUsers WHERE StudentName='" & Student & "';"
.CursorType = 3
.CursorLocation = 2
.LockType = 3
.Open()
.Fields("Email") = Request.Form("Email")
.Fields("Rotation1") = Request.Form("Rotation1")
.Fields("Rotation2") = Request.Form("Rotation2")
.Fields("Rotation3") = Request.Form("Rotation3")
.Fields("Rotation4") = Request.Form("Rotation4")
.Fields("Rotation5") = Request.Form("Rotation5")
.Fields("Rotation6") = Request.Form("Rotation6")
.Fields("Rotation7") = Request.Form("Rotation7")
.Fields("Rotation8") = Request.Form("Rotation8")
.Fields("Rotation9") = Request.Form("Rotation9")
.Fields("UserName") = Request.Form("StudentName")
.Fields("Password") = "student"
.Fields("Contact") = Request.Form("Contact")
.Fields("Address") = Request.Form("Address")
.Fields("AccessAllowed") = True
.Update
End With
Response.Redirect "/default.asp"
Else
strErrorMessage = "Please enter an email address."
End If
Else
strErrorMessage = "Please enter the students name."
End If
End If
%>
<title>Student Update Wizard
Student Update Form (All fields required)
<%
If Len(Request.Form("Submit")) > 0 AND Len(strErrorMessage) > 0 Then
Response.Write " " & strErrorMessage
End If
%>
|
Student Full Name:
(First and Last)
|
| <%=rsUser("StudentName")%>
|
Student Contact Name:
|
| <%=rsUser("Contact")%>
|
Student Address:
|
| <%=rsUser("Address")%>
|
Email Address:
|
| <%=rsUser("Email")%>
|
Rotation1
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation1")%>
|
Rotation2
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation2")%>
|
Rotation3
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation3")%>
|
Rotation4
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation4")%>
|
Rotation5
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation5")%>
|
Rotation6
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation6")%>
|
Rotation7
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation7")%>
|
Rotation8
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation8")%>
|
Rotation9
|
Titles
<%
on error resume next
TitleChoice.MoveFirst
do while not TitleChoice.eof
title=TitleChoice("title")
%>
"><%=title%>
<%
TitleChoice.movenext
loop
%>
| <%=rsUser("Rotation9")%>
|
|
|
|
|
|
|
|
I have a table which has a field "ID". The default ID of the field calls the newid() function and generates a GUID. This all works fine.
I would like to return the new record ID to my app after adding a record via ADO AddNew. How can I do this. I have tried trying to get the value from the field after the call to AddNew but it returns a VT_EMPTY. I've tried doing it after the Update call but that is also VT_EMPTY.
This is the code I'm using,
Recordset.Create();
Recordset.Open("calls", *m_pConnection, littleADO::adOpenDynamic,littleADO::adLockOptimistic,littleADO::adCmdTable);
variant_t vt;
try
{
Recordset.AddNew();
Recordset.m_pRecordset->Fields->Item["Ref"]->Value = pData->m_sRef.c_str();
Recordset.m_pRecordset->Fields->Item["PoliceForceID"]->Value = pData->m_sPoliceForceID.c_str);
Recordset.m_pRecordset->Fields->Item["DivisionID"]->Value = pData->m_sDivisionID.c_str();
Recordset.m_pRecordset->Fields->Item["LocationID"]->Value = pData->m_sLocationID.c_str();
Recordset.m_pRecordset->Fields->Item["CustodyID"]->Value = pData->m_sCustodyID.c_str();
Recordset.m_pRecordset->Fields->Item["CustodyDesc"]->Value = pData->m_sCustodyDesc.c_str();
Recordset.m_pRecordset->Fields->Item["CallTime"]->Value = COleVariant(pData->m_CallTime);
Recordset.m_pRecordset->Fields->Item["Status"]->Value = pData->m_nStatus;
Recordset.m_pRecordset->Fields->Item["UserName"]->Value = pData->m_sUserName.c_str();
// try and get the id here
vt = Recordset.m_pRecordset->Fields->Item["ID"]->Value;
Recordset.m_pRecordset->Update();
vt = Recordset.m_pRecordset->Fields->Item["ID"]->Value;
}
Michael
|
|
|
|
|
I've changed my code to use a stored procedure which returns the value of the ID back as an output parameter. This works pretty well.
I'd still be interested to know if it is possible via AddNew though.
Michael
|
|
|
|
|
Hallo
Does anyone know how I can check, if a dBase-recordset is deleted while using ADO?
Thanks.
|
|
|
|
|
Hi, I don't know how to detect deleted record via ADO, but I know the file structure and there is asterisk in the dbf file.
Alex.
|
|
|
|
|
I found an interesting article comparing various databases, MS SQL among them. They mainly used JDBC to test the dbs, and surprise surprise, MS SQL didn't do so hot. But, when MS SQL was used in an all MS environment, it more than held its own.
Jon Sagara
What about ?
Sonork ID: 100.9999 jonsagara
|
|
|
|
|
Very Interesting...
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for "still doesn't work."
|
|
|
|