'strQuery是表名,查询名等Public Function Getrs(Byval strQuery as string) as ADODB.RecordsetDim objRs As New ADODB.Recordseton Error GoTo Error_GetrsobjRs.open strQuery,CurrentProject.connection'程序调试用'Do While Not objRs.EOF' Debug.Print objRs(0) & vbTab & objRs(1) & vbTab & _'objRs(2)' objRs.MoveNext'LoopSet Getrs =objRsExit _Getrs:Exit FunctionError_Getrs:MsgBox (Err.Description)Resume Exit _GetrsEnd Function
如果觉得《access vba 用recordset读取表中数据的简单方法》对你有帮助,请点赞、收藏,并留下你的观点哦!