/FizzDB/SampleSave.asp 8/20/2008 1:05:07 PM

Create/Use Table
JLD Family Example
  • Shows how to create a table, a record and record a nugget.
  • 	' First create a table for the family
    	Call fizzGetTable("JLDFamily")       ' Check that table exists (it will create it if necessary)
    
    	' Create a record
    	famKey = fizzNewRecord("JLDFamily", "FamilyRecord")  ' Create a record for our data
    
    	' Add Nuggets to the record
    	Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TEXT, "FamilyName",     "Davis")
    	Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TEXT, "Presents",       "Shoes")
    	Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_TIME, "Done Wrapping",  "12/25/2001 2:30AM")
    	Call fizzAddNugget("JLDFamily", "FamilyRecord", famKey, FIZZTYP_MONEY,"Budget",         "$100.00")
    	' Note: we added several new kinds of data (FamilyName,Presents,Done Wrapping,Original Budget)
    
    	' We can add other types of records to any table.
    	' Lets keep track of the kids
    	kidKey = fizzNewRecord("JLDFamily", "KidRecord")        ' Create new record
    	Call fizzAddNugget("JLDFamily", "KidRecord", kidKey, FIZZTYP_TEXT, "KidName", "Sarah")
    	
    	' Lets add a pointer.  We want to know which family this kid belongs to.
    	' Note: use the family key as the pointer
    	Call fizzAddNugget("JLDFamily", "KidRecord", kidKey, FIZZTYP_PTR,  "Family PTR", famKey)
    
    	' Why stop, let's set up the local basketball team too!
    	teamKey = fizzNewRecord("JLDFamily", "TeamRecord")      ' Create a Team Record
    	Call fizzAddNugget("JLDFamily", "TeamRecord", teamKey, FIZZTYP_TEXT, "Sport", "Basketball")
    	Call fizzAddNugget("JLDFamily", "TeamRecord", teamKey, FIZZTYP_TEXT, "Coach", "T.Smith")
    
    	' Now have our kid keep track of the team they are on.
    	Call fizzAddNugget("JLDFamily", "KidRecord",   kidKey, FIZZTYP_PTR,  "Team PTR", teamKey)
    

    Adding nuggets based on form input

    Insert into testSQLUsageTableDefaults
    SQL Default functions were set up in the testSQLUsageTableDefaults table.
    TABLE DOES NOT USE FIZZDATATEMPLATE FORMAT.
    Most functions have been moved/incorporated somewhere in fizzGetUsage (occuring at first execution). Result = 0atabase): Cannot open database!!

  • fizzNewRecord (Orphan Table not found in DB): Abandoning New Record Request "FIZZOrphan"
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzAddNugget (Table not found in DB): Using Orphan Table "JLDFamily"
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzAddNugget (Orphan Table not found in DB): Abandoning New Record Request "FIZZOrphan"
  • fizzGetRecDef (Validating arguments): Could not open database
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzNewRecord (Table not found in DB): Using Orphan Table "JLDFamily"
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzNewRecord (Orphan Table not found in DB): Abandoning New Record Request "FIZZOrphan"
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzAddNugget (Table not found in DB): Using Orphan Table "JLDFamily"
  • fizzGetTable (Open Database): Cannot open database!!
  • fizzAddNugget (Orphan Table not found in DB): Abandoning New Record Request "FIZZOrphan"
  • fizzSQLInsert//FizzDB/SampleSave.asp (ConnOpen): Error 80040E4D - [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'NATIONALDESKTOP\WebDomResourcePark'. "prdDBFizz"
  • fizzSQLInsert//FizzDB/SampleSave.asp (DBInsert): Error E78 - Operation is not allowed when the object is closed.
  • fizzSQLInsert//FizzDB/SampleSave.asp (ConnClose): Error E78 - Operation is not allowed when the object is closed.

    Retrieve Record(0) from testSQLUsageTableDefaultsOpenConn 0:


    End Fizz /FizzDB/SampleSave.asp @ 8/20/2008 1:05:08 PM