Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

substitute for registry

Status
Not open for further replies.

gzosh

Programmer
Joined
Jun 18, 2001
Messages
5
Location
US
I'd like to know how I can do what the following code does without using the registry.

Public Sub SaveProject()
Dim newProcess As CConnectors
Dim filename As String
Dim counter As Integer

filename = frmSaveAs.m_Save.filename
counter = 1
For Each newProcess In m_colObjects
SaveSetting filename, "Objects" & counter, "Left", newProcess.Left
SaveSetting filename, "Objects" & counter, "Top", newProcess.Top
SaveSetting filename, "Objects" & counter, "Inputs", newProcess.Inputs
SaveSetting filename, "Objects" & counter, "Outputs", newProcess.Outputs
SaveSetting filename, "Objects" & counter, "Process", newProcess.Process
SaveSetting filename, "Objects" & counter, "ProcessName", newProcess.ProcessName
SaveSetting filename, "Objects" & counter, "Picture", frmDragDrop.ImgProcess(counter).Picture
counter = counter + 1
Next
SaveSetting filename, "Objects", "Number", counter - 1
SaveSetting filename, "Lines", "Number", frmDragDrop.LineIndex - 1
For counter = 1 To frmDragDrop.LineIndex - 1
SaveSetting filename, "Lines" & counter, "X1", frmDragDrop.LineConnect(counter).X1
SaveSetting filename, "Lines" & counter, "X2", frmDragDrop.LineConnect(counter).X2
SaveSetting filename, "Lines" & counter, "Y1", frmDragDrop.LineConnect(counter).Y1
SaveSetting filename, "Lines" & counter, "Y2", frmDragDrop.LineConnect(counter).Y2
Next
End Sub
 
Or you could use a disconnected ADO recordset; I love these.

You can create the ADO recordset using code such as this:

Code:
Set rstAverages = New ADODB.Recordset
With rstAverages
    .Fields.Append "SamplingPort", adTinyInt
    .Fields.Append "Average", adDouble
    .Fields.Append "Step", adTinyInt
    .Fields.Append "Exercise", adVarChar, 50
    .Fields.Append "Fit", adDouble
    .Fields.Append "Penetration", adDouble
    .Fields.Append "CorrectedFit", adDouble
    .Fields.Append "CorrectedPenetration", adDouble
    .CursorLocation = adUseClient
    .Open , , adOpenStatic, adLockBatchOptimistic
End With

and then save it using the Save method to save it as an XML file to your harddrive/network share.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top