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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swith from dBase IV to Access 2007

Status
Not open for further replies.

amerifax

Technical User
Dec 28, 2006
37
I dont have much luck on questions about dBase so I Switched to Access 2007. Can any one show be the code I would need to run the following in Access 2007. It would give me a goos ubderstanding on how we use data.

Note: (For the most part)
a. lower case = code
b. upper case = table for file
c. First char cap = field names

dbase IV Coded Program

set safe off
close all

Sele 2
USE D:\Act\Current\PER_DIL excl
repl all ID with "UPD 10-2007"
*set order to
go top
x=0386192
*x=1
Do While .not. EOF()
repl per_dil->seqno with str(x,7,0,"0")
x=x+1
Skip
EndDo

Sele 1
USE d:\Act\Current\BUILDER excl
index on Bld tag TEMP
SELE 2
index on Bld tag TEMP
set rela to Bld into BUILDER
repl all Bldbuilder with BUILDER->Builder
repl all Bldbuilder with trim(Bld)+" - "+trim(Bldbuilder)
Sele 1
USE d:\Act\Current\SUB excl
index on Sb tag TEMP
SELE 2
USE D:\Act\Current\PER_DIL excl
index on Sb tag TEMP
set rela to Sb into SUB
repl all Sbsub with SUB->Sub
repl all Sbsub with trim(SB)+" - "+trim(Sbsub)
repl all Sbsub with proper(Sbsub)
Sele 1
USE d:\Act\Current\city excl
index on Sc tag TEMP
SELE 2
USE D:\Act\Current\PER_DIL excl
index on Sc tag TEMP
set rela to Sc into CITY
repl all Sctypecity with CITY->typecity
repl all Sctypecity with trim(SC)+" - "+trim(Sctypecity)
repl all Jobaddress with proper(Jobaddress)
repl all Own_Fst with proper(Own_Fst)
repl all Own_Lst with proper(Own_Lst)
repl all Own_Sec with proper(Own_Sec)
repl all Ownaddress with proper(Ownaddress)
repl all Own_City with proper(Own_City)
repl all Contact with trim(Own_Fst)+" "+trim(Own_Lst)

set order to
brow fields per_date,seqno,id,own_fst,own_lst,contact,sctypecity,sbsub,bldbuilder
*close all

Bob Snow
 
Hi

Dbase, long time ago since I used that, but...

set safe off
close all

Sele 2
USE D:\Act\Current\PER_DIL excl
repl all ID with "UPD 10-2007"
*set order to
go top
x=0386192
*x=1
Do While .not. EOF()
repl per_dil->seqno with str(x,7,0,"0")
x=x+1
Skip
EndDo

In Access, you could replace the above with something like:

Dim rs as Recordset
Dim x as Long
'
Docmd.setwarnings off
docmd.runsql "UPDATE [PERDIL] SET [ID] = 'UPD 10-2007';"
' Assuming form in which code is running is bound to Table PerDIl
x=0386192
Set Rs = Me.recordsetclone
rs.movefirst
do until rs.eof
Rs!seqno = Format("0000000",x)
rs.movenext
loop

but my advise is do not go for direct replacement, the DBase code you show is record orientated, in Access it is usually faster and easier to use SQL to manipulate sets

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top