|
-
Feb 24th, 2004, 05:10 PM
#1
Thread Starter
Fanatic Member
RESOLVED Dataset
OK,
I'm trying to place records from a dataset into some variables. Here is the code (long)
Code:
Public Function RetrieveInfo(ByVal id As Integer) As String
Dim conn As New CRAB.COMPSERV.SQL.SQLConn("sysadmin", "dogfish")
Dim ds As New DataSet()
conn.OpenDataSource()
ds = conn.SelectSqlData("Select * from SYSADMIN_MAIN where id = " & id, "SYSADMIN_MAIN", True)
sAppNumber = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("AppNum"))
sInputDate = CDate(ds.Tables("SYSADMIN_MAIN").Rows(0)("dt"))
sReleaseDate = CDate(ds.Tables("SYSADMIN_MAIN").Rows(0)("RDt"))
sProjName = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("PName"))
sProjType = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("PType"))
sSoftType = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SType"))
sAppType = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("AType"))
sContOwners = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("COwners"))
sContact = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("PContact"))
sProjScope = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("Scope"))
sAppDescrip = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("ADescription"))
sEnvironment = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("Environment"))
sPlatform = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("Platform"))
sDevStatus = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("DevStatus"))
sAppNumber = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("IUsers"))
sProgLangsMethods = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("PMethodLangs"))
sAppName = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("AppFlName"))
sSolName = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SolName"))
sAppLocation = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("AppLocation"))
sDependancies = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("LibSoftDep"))
sDatabaseUsage = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("dbAccessed"))
sDatabase1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db1"))
sRead1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db1Read"))
sWrite1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db1Write"))
sLocation1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db1Loc"))
sDBconnect1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db1ConnMethod"))
sDatabase2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db2"))
sRead2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db2Read"))
sWrite2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db2Write"))
sLocation2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("db2Loc"))
sDBConnect2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("dbConnMethod"))
sDesDbUsage = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("DBDescrip"))
sFileShares = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("flShareAccess"))
sBrowser = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("minBrowser"))
sServicePack = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SPReqs"))
sComments1 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SysComments"))
sKnownIssues = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("Issues"))
sAuthentication = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("EUsrAuth"))
sEscPriv = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("EscPriv"))
sEndAccountType = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("EndUsrAcct"))
sEndAccount = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("EUsrName"))
sServiceAccountType = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SvcAcct"))
sServiceAccount = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("SvcAcctName"))
sSecurity = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("DescripSecModel"))
sComments2 = CStr(ds.Tables("SYSADMIN_MAIN").Rows(0)("Comments"))
End Function
the problem is that it does not get any values after:
[code]
sInputDate = CDate(ds.Tables("SYSADMIN_MAIN").Rows(0)("dt"))
Starting with:
Code:
sReleaseDate = CDate(ds.Tables("SYSADMIN_MAIN").Rows(0)("RDt"))
It does not get anything in return for the query. It's so weird.
Last edited by brianh; Feb 24th, 2004 at 05:33 PM.
-
Feb 24th, 2004, 05:24 PM
#2
Fanatic Member
does it error or anything?
have you tried variable=mydataset.tables("whatever").rows(0).item(2)
just to check if there's anything in there?
-
Feb 24th, 2004, 05:27 PM
#3
Thread Starter
Fanatic Member
I just tried that. I still got nothing. It does not error out at all. When step through it, it just goes onto each variable ref and does not place anything in it. I don't understand.....
-
Feb 24th, 2004, 05:33 PM
#4
Thread Starter
Fanatic Member
RESOLVED
I think it got it. where it was reference a string (you did not see this, another part of code), it should have been a date. But, why would it stop allowing me to place the value of the record into strings. It does not make any sense.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|