Click here to Skip to main content
15,888,089 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Server deadlocks Pin
Kornfeld Eliyahu Peter13-Dec-15 20:23
professionalKornfeld Eliyahu Peter13-Dec-15 20:23 
GeneralRe: SQL Server deadlocks Pin
Member 1115415113-Dec-15 20:36
Member 1115415113-Dec-15 20:36 
GeneralRe: SQL Server deadlocks Pin
Member 1115415114-Dec-15 0:00
Member 1115415114-Dec-15 0:00 
SuggestionRe: SQL Server deadlocks Pin
Richard Deeming14-Dec-15 2:50
mveRichard Deeming14-Dec-15 2:50 
GeneralRe: SQL Server deadlocks Pin
Member 1115415116-Dec-15 2:28
Member 1115415116-Dec-15 2:28 
Questionneed to consult about project discussion Pin
divinity technologies10-Dec-15 22:14
divinity technologies10-Dec-15 22:14 
AnswerRe: need to consult about project discussion Pin
Mycroft Holmes11-Dec-15 1:26
professionalMycroft Holmes11-Dec-15 1:26 
QuestionCreating Access database with VB6 Pin
Member 121949778-Dec-15 18:05
Member 121949778-Dec-15 18:05 
I am creating a database in Access with 3 tables. Each table has different number of columns or fields. I get an error when creating more than 8 fields. If I comment out the other fields, then everything works great. Can anyone help? Code is as follows:

Dim FileName As String, strConn As String
Dim adoCat As ADOX.Catalog, adoTable As ADOX.Table
Dim tblCollection As Collection
Dim Script As Object

'check and/or build DB
Set Script = CreateObject("Scripting.filesystemobject")
If Script.FolderExists("C:\Business Pro") Then
'folder is in place...move on
If Dir("C:\Business Pro\BusinessPro.mdb") = "" Then
'dir not in place...build
lblPB.Caption = "No database found. Creating database..."
FileName = "C:\Business Pro\BusinessPro.mdb"
'create instance of ADOX-object
Set adoCat = New ADOX.Catalog
'creat instance of Collection-object
Set tblCollection = New Collection
Set adoTable = New ADOX.Table
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & FileName & ";"
'create the db
adoCat.Create (strConn)
'name table
tblCollection.Add "Customer_Contacts"
With adoTable
.Name = "Customer_Contacts" 'name the table
.Columns.Append "CustID", adInteger 'create a field in primary key
.ParentCatalog = adoCat 'set Parent catalog
.Columns("CustID").Properties("AutoIncrement").Value = True
.Keys.Append "PrimaryKey", adKeyPrimary, "CustID" 'append primary key
'add rest of fields
.Columns.Append "FirstName", adWChar
.Columns.Append "LastName", adWChar
.Columns.Append "Address", adWChar
.Columns.Append "City", adWChar
.Columns.Append "State", adWChar
.Columns.Append "Zip", adLongVarWChar, 5
.Columns.Append "PhoneNumber", adLongVarWChar, 10
End With
'add table to mdb
adoCat.Tables.Append adoTable

'create 2nd table
Set adoTable = New ADOX.Table
'name table
tblCollection.Add "Labor_Rates"
With adoTable
.Name = "Labor_Rates" 'name the table
.Columns.Append "ID", adInteger 'create a field in primary key
.ParentCatalog = adoCat 'set Parent catalog
.Columns("ID").Properties("AutoIncrement").Value = True
.Keys.Append "PrimaryKey", adKeyPrimary, "ID" 'append primary key
'add rest of fields
.Columns.Append "dateFiled", adDate
.Columns.Append "NumberCode", adWChar
.Columns.Append "Description", adWChar
.Columns.Append "LaborRate", adWChar
.Columns.Append "Frequency", adWChar

End With

'add table to mdb
adoCat.Tables.Append adoTable

'create 3rd table
Set adoTable = New ADOX.Table
'name table
tblCollection.Add "New_Contract"
With adoTable
.Name = "New_Contract" 'name the table
.Columns.Append "CustID", adInteger 'create a field in primary key
.ParentCatalog = adoCat 'set Parent catalog
.Columns("CustID").Properties("AutoIncrement").Value = True
.Keys.Append "PrimaryKey", adKeyPrimary, "CustID" 'append primary key
'add rest of fields
.Columns.Append "dateFiled", adDate
.Columns.Append "ProjectCode", adWChar
.Columns.Append "Name", adWChar
.Columns.Append "Address", adWChar
.Columns.Append "City", adWChar
.Columns.Append "State", adWChar
.Columns.Append "Description", adWChar
.Columns.Append "LaborRate", adWChar
'error is here. when the last 2 columns are commented out, the code works fine. When uncommented, I get an error of file being too large...
' .Columns.Append "DaysOnJob", adLongVarWChar
' .Columns.Append "Remarks", adWChar

End With
'add table to mdb
adoCat.Tables.Append adoTable

'release objects from memory
Set adoTable = Nothing
Set tblCollection = Nothing
Set adoCat = Nothing

Else:
lblPB.Caption = "Database exists. Loading software..."
tmrLoad.Enabled = True
tmrLoad.Interval = 1000

End If
Else
'make directory
MkDir "C:\Business Pro"
'file is created. Create db...run through process again
chkForDB
End If
End Sub
AnswerRe: Creating Access database with VB6 Pin
Mycroft Holmes8-Dec-15 20:46
professionalMycroft Holmes8-Dec-15 20:46 
GeneralRe: Creating Access database with VB6 Pin
Member 121949778-Dec-15 21:03
Member 121949778-Dec-15 21:03 
GeneralRe: Creating Access database with VB6 Pin
Mycroft Holmes9-Dec-15 1:23
professionalMycroft Holmes9-Dec-15 1:23 
AnswerRe: Creating Access database with VB6 Pin
CHill609-Dec-15 5:29
mveCHill609-Dec-15 5:29 
GeneralRe: Creating Access database with VB6 Pin
Member 121949779-Dec-15 21:18
Member 121949779-Dec-15 21:18 
GeneralRe: Creating Access database with VB6 Pin
CHill6010-Dec-15 5:23
mveCHill6010-Dec-15 5:23 
QuestionHow to update sequence in MySQL Pin
Jassim Rahma8-Dec-15 4:10
Jassim Rahma8-Dec-15 4:10 
AnswerRe: How to update sequence in MySQL Pin
CHill608-Dec-15 4:40
mveCHill608-Dec-15 4:40 
QuestionGiving access permissions to user webadminqa_iispool Pin
indian1434-Dec-15 12:23
indian1434-Dec-15 12:23 
AnswerRe: Giving access permissions to user webadminqa_iispool Pin
Mycroft Holmes4-Dec-15 13:03
professionalMycroft Holmes4-Dec-15 13:03 
AnswerRe: Giving access permissions to user webadminqa_iispool Pin
Richard Deeming7-Dec-15 1:34
mveRichard Deeming7-Dec-15 1:34 
QuestionHow to manage 1000 millions of record in Mysql database Pin
Member 120698693-Dec-15 20:28
Member 120698693-Dec-15 20:28 
AnswerRe: How to manage 1000 millions of record in Mysql database Pin
Richard MacCutchan3-Dec-15 22:44
mveRichard MacCutchan3-Dec-15 22:44 
AnswerRe: How to manage 1000 millions of record in Mysql database Pin
jschell4-Dec-15 12:39
jschell4-Dec-15 12:39 
QuestionSQL Linq, IQueryable, ToList, just get 1 result Pin
jkirkerx3-Dec-15 11:43
professionaljkirkerx3-Dec-15 11:43 
AnswerRe: SQL Linq, IQueryable, ToList, just get 1 result Pin
Richard Deeming4-Dec-15 1:17
mveRichard Deeming4-Dec-15 1:17 
GeneralRe: SQL Linq, IQueryable, ToList, just get 1 result Pin
jkirkerx4-Dec-15 7:04
professionaljkirkerx4-Dec-15 7:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.